AX4 WCF Errors

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.

The solution:

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

Advertisements

About John Winford

Based in Vancouver, Canada I’m an IT professional with a number of specialties. First and foremost I am the front-line between the business users I enable and the technical team I represent. Not content to simply push the paper I also get my ‘hands dirty’ when required. I have an extensive amount of experience with technical project management, ERP implementations, BI work, and development across SharePoint, CRM and generic Widows applications.
This entry was posted in Dynamics AX. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s