Friday, 22 March 2013

How to configure IIS for Syspro 6.1 Web Services


Introduction

This document describes how to correctly install and configure IIS for use with Syspro Web Services.
Ideally, this should be done before you install Syspro Web Services, but it can be done after; you may just have to check your Application Pool (see details below).

Install IIS

Use this guide if you don't already have IIS installed:
http://www.iis.net/learn/install/installing-iis-7/installing-iis-7-and-above-on-windows-server-2008-or-windows-server-2008-r2

In Windows 7 Professional, you can find these features by going to Start / Control Panel / Turn Windows features on or off (see screen shot below).


Install IIS 6 Management Compatibility

You also need to install the IIS 6 Management Compatibility for Syspro 6.1 with the options as shown in the screen shot below:


How to install the IIS 6 Management Compatibility features on Windows Server 2008

Run Server Manager; go to Server Manager / Roles and scroll down to Role Services.



If the required roles are not installed, click Add Role Services.
Tick the desired roles, i.e. everything under Web Server and Management Tools, as shown in the screen shot below and then click Next to install them.


Configure your Application Pool

Run IIS and go to the SysproWebServices Site.
Click on Basic Settings. Check that the Application Pool is a .Net Framework version 2.0 pool.



If the Application Pools is not a .Net Framework version 2.0 pool, go to Application Pools and add a new one, as shown in the screen shot below.



Check you are using a 32-bit Application Pool

Click on Advanced Settings. Check that 32-bit mode is enabled.


Set Maximum Worker Processes

Also in the Application Pool's Advanced Settings, set the Maximum Worker Processes to something greater than 1; ideally it should be 1 + the normal maximum number of simultaneous business object calls you will need to service.




Permissions

The IIS_IUSRS user must have both Read and Write access to the Syspro60 or Syspro61 directory (and, obviously all those folders and files within).

You should now be ready to run. Restart your web site and test using Syspro's e.Net Diagnostics Manager.

Errors

SoapException

An error you can get when running Web Services, perhaps from E.Net Diagnostics, is:


Error
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: Unable to open and read operator file (ADMOPR.DAT)
   at SysproServices.utilitiesclass.Logon(String Operator, String OperatorPassword, String CompanyId, String CompanyPassword, Language LanguageCode, LogDetail LogLevel, Instance EncoreInstance, String XmlIn)
   --- End of inner exception stack trace ---




For that error, check that the user, IIS_IUSRS, has full access to the Syspro61 directory by going to Windows Explorer, right-click on the Syspro61 installation directory, and check the security: make sure that IIS_IUSRS has full control, as shown in the screen shot below:


Installation Incomplete

When you are installing Syspro Web Services, you may get this error:
"Installation Incomplete. The installer was interrupted before SYSPRO Web Services could be installed. You need to restart the installer to try again."


This error occurs if you haven't installed IIS 6 Management Compatibility on your server. See instructions at the top of this document for how to install IIS 6 Management Compatibility.




How to fix {FE41B1AD-0F2B-459C-9668-5FC6BBF093EE} Class not registered in Syspro

There are a number of reasons why you can get this error in Syspro:


Error
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {FE41B1AD-0F2B-459C-9668-5FC6BBF093EE} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
   at SysproServices.utilitiesclass.Logon(String Operator, String OperatorPassword, String CompanyId, String CompanyPassword, Language LanguageCode, LogDetail LogLevel, Instance EncoreInstance, String XmlIn)
   --- End of inner exception stack trace ---


Encore.dll not registered

The CLSID, {FE41B1AD-0F2B-459C-9668-5FC6BBF093EE}, refers to Encore.DLL, which is a 32-bit DLL that should live under your Syspro base folder, e.g. C:\Syspro61\Base\Encore.dll.

This DLL should be registered; you can register this by running an elevated command prompt and running these commands:

cd C:\Syspro61\Base
regsvr32 Encore.dll

Run as a 32-bit process

However, the problem usually happens when you run a 64-bit process and try to access Encore.dll, which is a 32-bit dll, because you can't mix 32-bit code with 64-bit code in the one process.

Therefore, to talk to Syspro's E.Net BUsiness Objects, you may have to change your process so that it is a 32-bit process.

If you made your own program using Visual Studio to access Syspro via E.Net, then you can force your application to run as a 32-bit process using this procedure:

In Visual Studio, go to Tools / Options / Projects and Solutions / General and tick Show advanced build configurations as shown in the screen shot below.


Then go to Build / Configuration Manager, click on the options for Platform, go to New, add x86, and set the Platform to x86, as shown in the screen shot below. You should do this process for both the Debug and the Release configurations.


Then rebuild your application.

Run as a 64-bit process - use web services

Another solution is to change from talking to Syspro's Business Objects via Encore.dll, to using Syspro's Web Services instead. If you are using VBScript / VBA in Excel or a similar Microsoft Office application, see this post for how to change to using web services.

Configure IIS correctly

Another source of the problem can be because of incorrect configuration of IIS for Syspro's E.Net web services. This can typically happen if you install Syspro Web Services BEFORE configuring IIS for Syspro Web Services. If that is the case, see this post this post for more detail on setting up IIS correctly for Syspro.