Hi there,
I have problem calling the webservice on NAV2009 R2.
I Installed the service on the same machine the sql server is installed.
I set up a WS in Form 810 and published it.
The service is running and I can open the service wsdl
http://[servername]:7047/DynamicsNAV/WS/Services |
http://[servername]:7047/DynamicsNAV/WS/[company]/Page/WSCustomer
I downloaded the xml and imported it in soapui.
When I submit the request
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="urn:microsoft-dynamics-schemas/page/WSCustomer">
<soapenv:Header/>
<soapenv:Body>
<cus:Read>
<cus:No>0000001</cus:No>
</cus:Read>
</soapenv:Body>
</soapenv:Envelope>
I get the result
#status# HTTP/1.1 401 Unauthorized.
I also set the Authorization to Basic entered a username / password of a user whitch is known in nav and has the role super.
Has anyone any idea?
Answers
You can try this Powershell script to test the connection:
Regards
How I told before, SoapUI does not work with the Authentication that use NAV, or at least I not been able to do.
Regards.
Thank you, it works, the true is that I don't use SoapUI much because I test WS with Powershell or XMLSpy.
Regards.
Could you elaborate ?
Is the error still the same ? 401 Unauthorized.
Regards
from
<add key="WebServicesUseNTLMAuthentication" value="false"></add>
to
<add key="WebServicesUseNTLMAuthentication" value="true"></add>
I restarted the NAV Services (Business Webservice and Server)
Then I did the same I described above
...
http://[myserver]:7047/DynamicsNAV/WS/Page/WSCust
Download the result as xml
Changed the Company (ReplaceWithAPercentEncodedCompanyName)
Create new soap in soapui, select the xml, ok
create a new read request
changed the customer no
<wsc:No>?</wsc:No>
-> <wsc:No>0000001</wsc:No>
select Auth -> add new -> ntlm
username
password
(domain)
-> fire
#status# HTTP/1.1 401 Unauthorized
Server Microsoft-HTTPAPI/2.0
Content-Length 0
Date Thu, 18 Apr 2019 05:59:23 GMT
WWW-Authenticate Negotiate
Well I don't know what to say, after the change for the "WebServicesUseNTLMAuthentication" value, it works for me.
Maybe you must check if you have more the one service runnig, because after the change the error message if there is a Authetication problem must be:
WWW-Authenticate NTLM
No
WWW-Authenticate Negotiate.
Regards
I can't see a second service but after changeing the port in the config the authentication works well.
Now there is another Problem: but for this there seems to be a hotfix (no longer available )
1. Remove all line breaks and unneccessary spaces between ><
2. Change the namespace 'soapenv' to 'soap'
thanks @goback (@mibuso)
If with the Plowershell script the WS works, that means that the problem must be with the XML that you are sending..
Try this, in this line change the cus urn to all lowercase
Like this:
That it is how the SoapUI version I use do it.
Regards.