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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Webservice response error bad request business central 14 onprem and cloud

(0) ShareShare
ReportReport
Posted on by 259

Hey,

we are experiencing a weird issue with consuming external soap webservice from BC 14 onprem and the cloud. The server response with bad request message and we don't know which part is causing the error. But, when running the code in BC 13, it works perfectly. here is the code for creating the header and sending:

  Request.SetRequestUri(URL);
        Request.Method('POST');
        XmlDoc.WriteTo(reqText);
        Content.WriteFrom(reqText);

        Content.GetHeaders(header);
        header.Remove('Content-Type');
        header.Add('Content-Type', 'text/xml;charset=utf-8');
        header.Add('SOAPAction', soapAction);

        Request.Content := Content;

        client.send(Request, response);

it seems like both BC versions processes the request differently.

i'm a missing something? what is the difference between those BC versions regarding Webservice calls?

hope somebody have a clue. 

  • jdecottignies Profile Picture
    217 on at

    Hi,

    Just tried your code with a HTTP POST request with a json body. It worked.

    pastedimage1577980469528v1.png

    So the only difference here is our content and content headers. Have you tried using Content-Type: text/xml or Content-Type: application/xml ?

    Did you have the very same code for v13 version that worked ?

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    try with a different browser, e.g. ie11 instead of edge.

    use 'charset="utf-8"' instead.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 645 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 432 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 248 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans