NAV Webservice in different language / date format
mboon75
Member Posts: 16
Hi,
I have implemented a Codeunit webservice in NAV2009 and passing a date as an argument to a method. I would like to have influence in what format the date is handled and i was assuming that the dutch language module could help me out. But that seems not the case.
I have changed the regional settings for the user that runs the NAV Server + Nav Server Webservice. but still same error.
The error i get:
Is there a way that i can set the culture information like webservice in IIS can have?
<globalization culture="nl-NL" uiCulture="nl-NL"/>
ANy other ideas how to fix this thing?
I have implemented a Codeunit webservice in NAV2009 and passing a date as an argument to a method. I would like to have influence in what format the date is handled and i was assuming that the dutch language module could help me out. But that seems not the case.
I have changed the regional settings for the user that runs the NAV Server + Nav Server Webservice. but still same error.
The error i get:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode xmlns:q0="urn:microsoft-dynamics-schemas/error">q0:Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException</faultcode>
<faultstring xml:lang="en-US">'13-11-2014' is not a valid date.</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">'13-11-2014' is not a valid date.</string>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Is there a way that i can set the culture information like webservice in IIS can have?
<globalization culture="nl-NL" uiCulture="nl-NL"/>
ANy other ideas how to fix this thing?
0
Comments
-
In my previous post i was not correct.
I'm not passing a date as argument but a text.
I have a simple codeunit
with a method ConvertToDateConvertToDate(DateText : Text[30]) returndate : Date EVALUATE(returndate, DateText);
I exposed the codeunit as a webservice called ConvertDate. When i call the method in a .Net application then i get the error when i post the date "13-11-2014".ConvertDate cd = new ConvertDate(); cd.UseDefaultCredentials = true; try { DateTime dt = cd.ConvertToDate(DatumBox.Text); DatumBox.Text = dt.ToShortDateString(); } catch (Exception ex) { MessageBox.Show(ex.Message); }The fun is when you submit a date "11-1-2009" then the above code is toggling the date. The outcome is DatumBox (which is a TextBox) contains "1-11-2009".
I run the NAV Server Tier under my own account, so regional settings are dutch. It seems the service tier does not take the regional settings of the user who runs the service.
Anymore ideas?0 -
thanks to Goncalo from MS Support, i have the solution to this issue.
Make an entry in Tabel User Personalization (2000000073) for the user that runs the NAV Server.
Set there the language to the desired language. The EVALUATE is then working fine too with the proper date format.
So, it is not considering the Regional Settings.0 -
thx for the solution for the date problem.
but I have another Problem:
My webservice only add an item comment and must send the NAV default error message to the outstanding application.
If the item does not exist, the user must get the error message in his language.
Now I use the tipp of mboon75 and the caption of the field "Item No." is translated (German: "Artikel Nr."). But the rest of the default error message is still english?!--------------------------- Artikel Nr. 'A' does not exist. --------------------------- OK ---------------------------
has someone a rease for this? or better a solution?0 -
This is indeed strange.
What is the NAV code that is executed?
The text constant is translated?0 -
sry for my late response

this is an internal error message, not an programmed error('');
0 -
same here!http://www.mibuso.com/forum/viewtopic.php?f=32&t=58051&view=unread#unread
sorry for cross posting but i didn't find this error before.
Obviously, i've already checked all the language pack folders.0 -
What I generally do in SOAP/XML is pass the date in xml format (yyyy-MM-dd), so 2014-11-13. In the EVALUATE, you can then also indicate that format:
EVALUATE(returndate, DateText, 9);
The 9 argument tells the EVALUATE function to look for xml-standard formats. It's a good way to keep things like dates and times language-independent.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
