Call to NAV Web Service from Classic works from RTC don't
PureHeart
Member Posts: 190
](*,) ](*,) ](*,)
Please Help I'm Desperate!
I've done some coding in the classic to call a NAV 2009 codeunit function exposed as web service...
This works fine if I try to call it from the Classic Client but when instead I call it from the RTC I have this message:
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <s:Body>
- <s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException</faultcode>
<faultstring xml:lang="en-GB">The user ID and password are invalid. Try again.</faultstring>
- <detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">The user ID and password are invalid. Try again.</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Why is doing that?
I don't understand please help me to solve and understand why!!!!
THANKS!
Please Help I'm Desperate!
I've done some coding in the classic to call a NAV 2009 codeunit function exposed as web service...
XmlHttp.open('POST','http://localhost:7047/' + NAVServerName + '/ws/' + Company.Name + '/Codeunit/' +
WebService."Service Name",0);
XmlHttp.setRequestHeader('Content-Type','text/xml; charset=utf-8');
XmlHttp.setRequestHeader('SOAPAction','ConvertWAMPS2Vendor');
//The last parameter set to zero allows to wait till webservice finishes
XmlHttp.setTimeouts(10000,10000,10000,0);
XmlHttp.send('<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
'<soap:Body><ConvertWAMPS2Vendor xmlns="urn:microsoft-dynamics-schemas/codeunit/' +
WebService."Service Name" + '">' +
'</ConvertWAMPS2Vendor></soap:Body></soap:Envelope>');
XmlDoc.async := FALSE;
XmlDoc.load(XmlHttp.responseBody);
XmlDoc.save('C:\' + Company.Name + 'testwebresponse.xml');
IF XmlHttp.status <> 200 THEN BEGIN
XmlNode := XmlDoc.selectSingleNode(ErrorDetailPath);
IF NOT ISCLEAR(XmlNode) THEN
MESSAGE(Company.Name + ': ' + XmlNode.text)
ELSE
MESSAGE(Company.Name + ' Http Error ' + ' ' + FORMAT(XmlHttp.status) + ': ' + XmlHttp.statusText);
END ELSE BEGIN
//ALL OK
END;
This works fine if I try to call it from the Classic Client but when instead I call it from the RTC I have this message:
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <s:Body>
- <s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException</faultcode>
<faultstring xml:lang="en-GB">The user ID and password are invalid. Try again.</faultstring>
- <detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">The user ID and password are invalid. Try again.</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Why is doing that?
I don't understand please help me to solve and understand why!!!!
THANKS!
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=1123
http://www.mibuso.com/dlinfo.asp?FileID=1123
0
Comments
-
When you run the code XmlHttp is instantiated at the service tier and thus uses the service tier account to make the authenication.
XmlHttp.open( has additional parameter for userID and password that you can pass, Or instantiate the XmlHttp at client side so it uses users credentials.0 -
Ok Thanks but I've then added the "NT AUTHORITY\NETWORK SERVICE" account to the database (which is the one used by the NAV Server) but it still doesn't work?!
Any Idea why?Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
change your code and pass login and password in Open function first.0
-
Yes Thanks It works


But Do you know if it is possible to be able to make the call passing the current user logged into the system instead of having an extra windows account to do this?Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
change the .code to
create(XmlHttp,true,true);0 -


You are the best thank you so much!
But now I remember why I didn't create the automation on the client...If I replace in the server address "localhost" with the name of the server then it doesn't work

Giving me the error:
Http Error 401: Unauthorized
How do I fix it?Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Are you part of Domain? If Yes, try to connect through VPN first.
Can you access the WSDL through Internet Explorer?
Can you try the ip address instead?0 -
Yes I'm part of a Domain and I'm connected through VPN but I've loaded everything on my laptop so I have SQL running and the NAV Server running on my machine....
I can access the WSDL from ie using the name of the machine without any problem, I've also installed another instance of the NAV Server on another machine with another SQL database and I can access from ie the WSDL of that machine using the computer name but it doesn't work when I do the same via code

!
I haven't tried with the IP Address but I'll try later on when in the Office....but why does work from ie and not from code what is different?
Thanks Again!Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
PureHeart wrote:Yes I'm part of a Domain and I'm connected through VPN but I've loaded everything on my laptop so I have SQL running and the NAV Server running on my machine....
I can access the WSDL from ie using the name of the machine without any problem, I've also installed another instance of the NAV Server on another machine with another SQL database and I can access from ie the WSDL of that machine using the computer name but it doesn't work when I do the same via code

!
I haven't tried with the IP Address but I'll try later on when in the Office....but why does work from ie and not from code what is different?
Thanks Again!
Anyone Please any idea? ](*,) ](*,)Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Ok that was me being stupid....
We have a proxy server in the Office...http://support.microsoft.com/kb/291008
If can help someone you have to use the "setproxy" instruction before making the call! \:D/Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230
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
