The AX Business Connector is extremely useful for accessing AX functionality and data from external programs. The connector has been around for a number of years and is still going strong. When testing a custom service leveraging the AX 4 connector using the WCF Test Client provided with Visual Studio 2012, the following error appeared:
The remote server returned an error: NotFound.
Obviously this is not all that helpful. Editi the web.config file and enabling debugging:
<behaviors> <serviceBehaviors> <behavior name=""> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true" /> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> <behavior name="AXServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors>
After an IISReset, a more informative error appeared:
Could not load file or assembly ‘Microsoft.Dynamics.BusinessConnectorNet’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Which was strange as the file is present in the GAC.
AX 4.0 is getting a bit long in the tooth – running on operating systems in development environments released in 2012 is bound to cause issues.
• After installing the Business Connector, restart the server even if not prompted
• Ensure the IIS application pool running the service is a supported .NET version (4.0 works)
• Ensure the account running the application pool has the required AX access levels
• Ensure the custom application is compiled with ‘Any CPU’
• Ensure the application pool is set to support 32 bit applications. IIS –> Select the Application Pool –> Advanced Settings –> Enable 32-bit Applications