web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to retrieve SOAP data from the URL and store in XML Format in Navision

(0) ShareShare
ReportReport
Posted on by 10

While retrieve the data Using SOAP API  I am getting this issue

''A call to System.Net.HttpWebRequest.GetResponse failed with this message: The remote server returned an error: (403) Forbidden.''

while using SOAP UI tool  for the testing data retrieved successfully in XML Format. In the code level it is not possible.

Can any one suggest where i need to check ?

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,700 Moderator on at

    Hi,

    Seems that its permission issue, can you please share your code?

    Thanks

  • Shekhar30 Profile Picture
    10 on at

    I have provided the URL

    From below line i am getting error. I don't have any username and password  to pass as parameter

    WebServiceReqManagement.SetGlobals(ReqBodyInsteam,Url,' ',' ');

    TempBlob.DELETEALL;

    TempBlob.INIT;

    TempBlob.Blob.CREATEOUTSTREAM(ReqBodyOutSteam);

    ReqText.WRITE(ReqBodyOutSteam);

    TempBlob.INSERT;

    TempBlob.CALCFIELDS(Blob);

    IF TempBlob.Blob.HASVALUE  = TRUE THEN BEGIN

     TempBlob.Blob.CREATEINSTREAM(ReqBodyInsteam);

     WebServiceReqManagement.SetGlobals(ReqBodyInsteam,Url,' ',' ');

     WebServiceReqManagement.DisableHttpsCheck;

     WebServiceReqManagement.SetTraceMode(TRUE);

     WebServiceReqManagement.SendRequestToWebService;

     //For security Purpose

     ServicePointManager.SecurityProtocol(SecurityProtocol.Tls12);

     //Get the Response

     WebServiceReqManagement.GetResponseContent(ResBodyInsteam);

     ResXMLDoc := ResXMLDoc.XmlDocument;

     ResXMLDoc.Load(ResBodyInsteam);

     MESSAGE(ResXMLDoc.InnerXml);

     ResXMLDoc.Save('D:\XML\XML.xml');

    END;

  • Suggested answer
    Nitin Verma Profile Picture
    21,700 Moderator on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans