Hi experts,
I've created a codeunit which calles to an external webservice, that webservice get my back a xml as a parameter (no physical xml file). So, with that parameter (xml) I'm calling to my xmlport because I want to import that information in a NAV table.
So I'm doing this
..
..
HttpWebRequest := HttpWebRequest.Create(ServiceUrl);
HttpWebRequest.Method := 'GET';
HttpWebRequest.Headers.Add('Authorization','Basic ' + Convert.ToBase64String(Encoding.ASCII.GetBytes(GlobalUsername + ':' + GlobalPassword)));
HttpWebResponse := HttpWebRequest.GetResponse;
ResponseInStream := HttpWebResponse.GetResponseStream;
CLEAR(OnlineXML);
OnlineXML.SETSOURCE(ResponseInStream);
OnlineXML.IMPORT;
The webservice is working fine, because I receive the InStream properly. But the system breaks down in the OnlineXML.IMPORT.
Am I calling properly to the xmlport??? Do you know what am I doing wrong??
Thanks
0
Comments
I suggest, in order to sort things out you dump the response to a file, then make sure it is a valid xml file in the first place. Then make sure, your XMLport works on that response file.