SOAP uses different datetime format

1.1k views Asked by At

In Dynamics Nav (2013) I have a codeunit that is accessible with the soap services to run a XML port. If I enter in the proper URI for this codeunit to run the port, the XML data is imported OK. Also if I just run the XMLPORT.IMPORT function from in NAV is will properly import the XML data file.

But if I use the SoapHttpClientProtocol class to run the codeunit then the dates that are in the XML data are imported backwards. The months and days are switched around. I have tried copying my regional settings to the Network Service account with no luck.

Any other possible fixes or reasons on why the data-time format is different when ran through code?

1

There are 1 answers

0
Ryan Erb On BEST ANSWER

So in my long lost search for why this bug is happening I finally stumbled upon this:

http://blogs.msdn.com/b/nav/archive/2012/11/07/nav-2013-soap-web-services-on-a-multilanguage-environment.aspx

All SOAP operations are forced to use EN-US culture and CANNOT be changed. But it seems that this has been reverted in a new build of 2013 R2 in April. You just have to add: <add key="ServicesCultureDefaultUserPersonalization" value="true"/> to your CustomSettings.config file (if you are using a service instance, ensure you change the proper one under [path-to-NAV]\71\Service\Instances\ folder) and it should use whatever culture you have in the user personalization table