Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Web service does not work when called from web shop

(0) ShareShare
ReportReport
Posted on by 543

Hi experts,

A company is making a new web shop for our customer. The web shop is calling the NAV page 42 ("Sales Order") in order to create a new sales order and some lines on it.

When they use Wizdler in the Google Chrome browser, it works fine.

When they use their own code to call NAV, there are some "401 Unauthorized" http errors and one "400 Bad request". They don't get any other error messages.

They have made a web shop for one of our other NAV customers,  but that was not NAV 2016.

They mention that they use http 1.1, but in the errors (see below) "Server: Microsoft-HTTPAPI/2.0" is mentioned. Could that be the problem?

They can easily create a customer using one of the other web services (standard NAV page 21).

If they don't send the customers address in the request, they still get the "401 Unauthorized" errors, but then they get the "200 OK" message - and they do NOT get the record with all it's fields as a result from NAV.

Can the size of the request be the problem?

I hope, you can help me.

----

* Expire in 0 ms for 6 (transfer 0x2496e641570)

*   Trying 87.63.99.117...

* TCP_NODELAY set

* Expire in 200 ms for 4 (transfer 0x2496e641570)

* Connected to 87.63.99.117 (87.63.99.117) port 7047 (#0)

> POST /SC-NAVudv/WS/SC/Page/SalesOrderMon HTTP/1.1

Host: 87.63.99.117:7047

Accept: */*

Method: POST

Connection: Keep-Alive

User-Agent: PHP-SOAP-CURL

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:microsoft-dynamics-schemas/page/salesordermon:Create"

Content-Length: 1388

Expect: 100-continue

* Expire in 1000 ms for 0 (transfer 0x2496e641570)

< HTTP/1.1 401 Unauthorized

< Content-Length: 0

< Server: Microsoft-HTTPAPI/2.0

< WWW-Authenticate: Negotiate

< Date: Mon, 21 Sep 2020 12:38:31 GMT

* Closing connection 0

* Issue another request to this URL: '87.63.99.117:7047/.../SalesOrderMon'

* Hostname 87.63.99.117 was found in DNS cache

*   Trying 87.63.99.117...

* TCP_NODELAY set

* Expire in 200 ms for 4 (transfer 0x2496e641570)

* Connected to 87.63.99.117 (87.63.99.117) port 7047 (#1)

> POST /SC-NAVudv/WS/SC/Page/SalesOrderMon HTTP/1.1

Host: 87.63.99.117:7047

Accept: */*

Method: POST

Connection: Keep-Alive

User-Agent: PHP-SOAP-CURL

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:microsoft-dynamics-schemas/page/salesordermon:Create"

Content-Length: 1388

Expect: 100-continue

* Expire in 1000 ms for 0 (transfer 0x2496e641570)

< HTTP/1.1 401 Unauthorized

< Content-Length: 0

< Server: Microsoft-HTTPAPI/2.0

< WWW-Authenticate: Negotiate

< Date: Mon, 21 Sep 2020 12:38:31 GMT

* Closing connection 1

* Issue another request to this URL: '87.63.99.117:7047/.../SalesOrderMon'

* Hostname 87.63.99.117 was found in DNS cache

*   Trying 87.63.99.117...

* TCP_NODELAY set

* Expire in 200 ms for 4 (transfer 0x2496e641570)

* Connected to 87.63.99.117 (87.63.99.117) port 7047 (#2)

* Server auth using Negotiate with user 'md\spc-P'

> POST /SC-NAVudv/WS/SC/Page/SalesOrderMon HTTP/1.1

Host: 87.63.99.117:7047

Authorization: Negotiate TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAKALpHAAAADw==

Accept: */*

Method: POST

Connection: Keep-Alive

User-Agent: PHP-SOAP-CURL

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:microsoft-dynamics-schemas/page/salesordermon:Create"

Content-Length: 1388

Expect: 100-continue

* Expire in 1000 ms for 0 (transfer 0x2496e641570)

< HTTP/1.1 401 Unauthorized

< Content-Length: 0

< Server: Microsoft-HTTPAPI/2.0

< WWW-Authenticate: Negotiate TlRMTVNTUAACAAAABAAEADgAAAA1goninzxN3h1PMPYAAAAAAAAAAJgAmAA8AAAACgBjRQAAAA9NAEQAAgAEAE0ARAABABAAUwBQAEMAMAAxAFUARABWAAQAGgBhAGQAbQAuAG0AbwBuAHQAZQBzAC4AZABrAAMALABTAFAAQwAwADEAVQBEAFYALgBhAGQAbQAuAG0AbwBuAHQAZQBzAC4AZABrAAUAGgBhAGQAbQAuAG0AbwBuAHQAZQBzAC4AZABrAAcACAC5b24dFJDWAQAAAAA=

< Date: Mon, 21 Sep 2020 12:38:31 GMT

* Closing connection 2

* Issue another request to this URL: '87.63.99.117:7047/.../SalesOrderMon'

* Hostname 87.63.99.117 was found in DNS cache

*   Trying 87.63.99.117...

* TCP_NODELAY set

* Expire in 200 ms for 4 (transfer 0x2496e641570)

* Connected to 87.63.99.117 (87.63.99.117) port 7047 (#3)

* Server auth using Negotiate with user 'md\spc-P'

> POST /SC-NAVudv/WS/SC/Page/SalesOrderMon HTTP/1.1

Host: 87.63.99.117:7047

Authorization: Negotiate TlRMTVNTUAADAAAAGAAYAIwAAAA+AT4BpAAAAAQABABYAAAAEgASAFwAAAAeAB4AbgAAABAAEADiAQAANYKI4goAukcAAAAPbln7EAOxP3QHIRQJRjRKVW0AZABzAHAAYwAtAFAAYQBpAHIAeQBEAEUAUwBLAFQATwBQAC0AOABRAEgANwBDAEYAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACi3Fb8W8CxixCJ5BRVrJ0rAQEAAAAAAAC5b24dFJDWAXGCKHejia0AAAAAAAIABABNAEQAAQAQAFMAUABDADAAMQBVAEQAVgAEABoAYQBkAG0ALgBtAG8AbgB0AGUAcwAuAGQAawADACwAUwBQAEMAMAAxAFUARABWAC4AYQBkAG0ALgBtAG8AbgB0AGUAcwAuAGQAawAFABoAYQBkAG0ALgBtAG8AbgB0AGUAcwAuAGQAawAHAAgAuW9uHRSQ1gEGAAQAAgAAAAgAMAAwAAAAAAAAAAEAAAAAIAAAoHEBQytbdrWTzpkCv1CBBewomc3gz9/CsLBgIjt6jEYKABAAAAAAAAAAAAAAAAAAAAAAAAkAIgBIAFQAVABQAC8AOAA3AC4ANgAzAC4AOQA5AC4AMQAxADcAAAAAAAAAAAB0raGdbc6wBqaHfXAsHLfo

Accept: */*

Method: POST

Connection: Keep-Alive

User-Agent: PHP-SOAP-CURL

Content-Type: text/xml; charset=utf-8

SOAPAction: "urn:microsoft-dynamics-schemas/page/salesordermon:Create"

Content-Length: 1388

Expect: 100-continue

* Expire in 1000 ms for 0 (transfer 0x2496e641570)

< HTTP/1.1 400 Bad Request

< Content-Length: 0

< Server: Microsoft-HTTPAPI/2.0

< Date: Mon, 21 Sep 2020 12:38:31 GMT

* HTTP error before end of send, stop sending

* Closing connection 3

  • Morten Steengaard Profile Picture
    Morten Steengaard 543 on at
    RE: Web service does not work when called from web shop

    Hi Lars,

    That was exactly what was needed! Thank you very much.

    Best regards,

    Morten

  • Verified answer
    RE: Web service does not work when called from web shop

    Hi Morten,

    this is a bit of a guess so I hope you get ideas also from other sides, but check that "Use NTLM" is enabled in NST settings - this setting is disabled by default:

    pastedimage1600777301605v1.png

    And the logs you provided mention "Negotiate", so there is a chance that you just need to tick this box.

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans