Search code examples
wcfwcf-bindingmicrosoft-dynamicsdynamics-ax-2012dynamics-ax-2012-r3

WCF (Dynamics AX) - Service sending most properties null


I'm doing an ASPNet MVC integration with dynamics AX using web services.

We have 3 environments:

  • DEV
  • QA (Quality environment)
  • PROD

We've been developing it for a while on DEV and the services always worked.

Now we are passing it to the Quality Environment (QA, before PROD) and I changed the config to go to QA instead of DEV and we discovered a problem.

There are 2 services that send ~90% of their properties as NULL, the other 10% is ok.

We tried: - Created console that saves the XML being received from AX. - Reviewing web config - Re-adding web services

We discovered that if we just add the service to the project using the QA URL, it works, but if we add it using DEV URL and afterwards change the config to match the QA URL it doesn't work.

So, it's not about the code, but something on the DEV > QA merge of AX, right?

Any ideas?


Solution

  • Fix

    I found a fix for this.

    I discovered that if the column order is different from server to server (WCF Server) this kind of things will happen.

    I fixed it by downloading the WSDL and updating the reference from within Visual Studio.

    1. Downloaded WSDL (Url: http://?singleWsdl)
    2. Saved it to a folder in my pc
    3. Configure the URL in VS (Changed it to the file in my pc instead of the URL)
    4. Update service

    It's a bit boring because you have to change this every time you want to compile it for a different environment, but until I find a permanent solution it will work this way.