NAV 2017 Consuming Webservice Returning Error

madan729madan729 Member Posts: 4
Hi All,

I'm getting below error when trying to get response from a external webservice,

m7uigug5vvzm.png

Webservice has been consumed in NAV 2017 custom codeunit.

Below is the code i have written using CU1290, Debugger is stopping at CU1299 GetWebResponse method.
ReqText is a BigText Variable here.

Appreciate your help in solving this.

// save request text in instream
TempBlob."Primary Key" := 1;
TempBlob.Blob.CREATEOUTSTREAM(ReqBodyOutStream);

reqText.WRITE(ReqBodyOutStream);
TempBlob.Blob.CREATEINSTREAM(ReqBodyInStream);

// run the WebServReqMgt functions to send the request
WebServReqMgt.SetGlobals(ReqBodyInStream,Url,Username,Password);
WebServReqMgt.DisableHttpsCheck;
WebServReqMgt.SendRequestToWebService;

// get the response
WebServReqMgt.GetResponseContent(RespBodyInStream);
ResponseXmlDoc := ResponseXmlDoc.XmlDocument;
ResponseXmlDoc.Load(RespBodyInStream);
MESSAGE(ResponseXmlDoc.InnerXml);
ResponseXmlDoc.Save('C:\Temp\XML\Response-New.txt');

Thanks,
Madan Reddy.

Answers

Sign In or Register to comment.