Hello,
I have a problem when calling a webservice out off NAV 2009 SP1.
The following lines are used.
XmlHttpLaut.open('POST', VarURL, FALSE);
XmlHttpLaut.setRequestHeader('Content-type','text/xml; charset=utf-16');
XmlHttpLaut.setRequestHeader('SOAPAction', VarSoapaction);
XmlHttpLaut.setRequestHeader('Timeout','100000');
XmlHttpLaut.send(XmlDocLaut);
VarURL is a variable with the url of the webservice.
When VarURL has the correct url everything is working well.
When VarURL has the wrong url an error occures for the method Open.
Is it possible to catch this error in NAV so I can generate an error myself?
Thanks in advance.
0
Answers
Pargesoft
The following error occures which is not clear for a user.
This message is for C/AL programmers.
An exeption occured with the method Open.
....
....
So it would be nice I can catch this error when calling the XmlHttpLaut.open method.
And I have no code outside NAV.
Why don't you use switch statements based on Error Codes that display user friendly messages?
Pargesoft
I'm quite new in calling webservices out of NAV.
Is there an example so I can see how this works?
Thanks in advance.
If not, you can play with the InnerException and Source properties of the Exception class.
Pargesoft
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!