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;
Comments
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.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Any Idea why?
http://www.mibuso.com/dlinfo.asp?FileID=1123
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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?
http://www.mibuso.com/dlinfo.asp?FileID=1123
create(XmlHttp,true,true);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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?
http://www.mibuso.com/dlinfo.asp?FileID=1123
Can you access the WSDL through Internet Explorer?
Can you try the ip address instead?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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!
http://www.mibuso.com/dlinfo.asp?FileID=1123
Anyone Please any idea? ](*,) ](*,)
http://www.mibuso.com/dlinfo.asp?FileID=1123
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/
http://www.mibuso.com/dlinfo.asp?FileID=1123