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...
Answered

Web Request error

(0) ShareShare
ReportReport
Posted on by 5

We have updated customer version from dynamics 2017 to dynamics bc and the servers are the same so the security permissions remains the same.

I' m having difficulties on a webrequest because on bc it took to long and gives timeout error, on dynamics 2017 that does not happen, its immediate.

Any idea why? I as looking ate codeunit 1299 Web Request Helper and the error occurs here HttpWebResponse := HttpWebRequest.GetResponse; on GetWebResponse function.

Thank you

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Web Request error

    You can also try to check NavHttpClientMaxTimeout parameter on the service tier.

    docs.microsoft.com/.../configure-server-instance

    If nothing change, I think you need a debug on both side (you and the final endpoint)

  • BC questions Profile Picture
    5 on at
    RE: Web Request error

    The answer is yess to all your questions that's why I don't understand why its tooks too long on BC

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Web Request error

    THis same code works in NAV 2017? Is this the same physical server? Can you reach the URL you're calling?

    A timeout error is normally due to unreachable endpoint or firewall problems.

  • BC questions Profile Picture
    5 on at
    RE: Web Request error

    Here it is...

    HttpWebRequestMgt.Initialize(STRSUBSTNO('apiservices.gtglobal.eu/.../access_token'));

    HttpWebRequestMgt.SetMethod('POST');

    HttpWebRequestMgt.AddBodyAsText(

    STRSUBSTNO('grant_type=password&username=*****&password=*****'));//hided on purpose to post the code here

    ltempBlob.INIT;

    ltempBlob.Blob.CREATEINSTREAM(lResponseInStrem);

    HttpWebResponse := HttpWebResponse.HttpWebResponse;

    StatusCode := HttpWebResponse.StatusCode;

    lResponseHeaders := HttpWebResponse.Headers;

    HttpWebRequestMgt.GetResponse(lResponseInStrem,StatusCode,lResponseHeaders);

    lResponseInStrem.READTEXT(ltxt);

    lTokenAccess := COPYSTR(ltxt,18);

    lTokenAccess := COPYSTR(lTokenAccess, 1, STRPOS(lTokenAccess, '"')-1);

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Web Request error

    If code is the same yes, also response should be the same. It's quite difficult to know the reason without seeing the code of the call.

  • BC questions Profile Picture
    5 on at
    RE: Web Request error

    Thank you for the answer...

    The code is exactly the same on both version, the behavior should not be the same?

  • Verified answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Web Request error

    Is the request sent correctly? What about authentication? Causes could be a lot.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 691

#2
YUN ZHU Profile Picture

YUN ZHU 682 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 495

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans