consuming NAV2009 Webservice via PHP
roederb
Member Posts: 6
Hello,
can't consume the NAV-Webservices via PHP nor get the service in soapui running, respectively proper results. adjustet the CustomSettings.config for the webservice configuration "WebServicesUseNTLMAuthentication" to true. so i can access the service via soapui but always get the result:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:System.Net.WebException</faultcode>
<faultstring xml:lang="de-DE">Soap message is invalid!</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Soap message is invalid!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
can anybody provide an example how to consume a webservice from within PHP?
Thanks in advance your help is highly appreciated
Kind regards
Bernd
can't consume the NAV-Webservices via PHP nor get the service in soapui running, respectively proper results. adjustet the CustomSettings.config for the webservice configuration "WebServicesUseNTLMAuthentication" to true. so i can access the service via soapui but always get the result:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:System.Net.WebException</faultcode>
<faultstring xml:lang="de-DE">Soap message is invalid!</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Soap message is invalid!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
can anybody provide an example how to consume a webservice from within PHP?
Thanks in advance your help is highly appreciated
Kind regards
Bernd
0
Comments
-
I recommend to use SOAPUI application to look how the request looks and how the answer looks like. It could help you to correctly create the XML request message etc..0
-
SOUPUI still can't authenicate. But you still can use it see how the xml file should be created.
Open the WSDL in internet explorer and save it as a file and then load that in SOAPUI.
This way you can see the XML structure you need to create.
The only solution I have is to use webproxy.
http://mibuso.com/blogs/ara3n/2009/05/0 ... b-service/0 -
Hi ara,
thanks for your advice. I found that threat before. i actually managed to authenticate with soapui - at least i think. i could load the definition into soapui and could open the wsdl. but the response i got was kind of soap message invalid :-(
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:System.Net.WebException</faultcode>
<faultstring xml:lang="de-DE">Soap message is invalid!</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Soap message is invalid!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Read some posts from Freddy telling he's providing some examples but couldn't find anything. nay ideas besides the proxy?
Thanks in advance
Bernd0 -
Is your php running in windows or linux?
If it's windows. You can use COM component (MSXMLDOM) and that works.
Here is example on how to use
http://mibuso.com/blogs/ara3n/2009/01/2 ... companies/0 -
Something like this? http://www.mehtanirav.com/2009/01/28/ws ... -wsdl-file
I think you can find many similar tools googling PHP and WSDL.0 -
Freddy has posted the blog on how to connect from PHP to NAV.
http://blogs.msdn.com/freddyk/archive/2 ... m-php.aspx
=D> =D>0 -
Yep - I am actually running through all the various platforms / programming languages I can think of (get access to) and make the very same sample on how to connect.
At this time I have covered PHP, Java, Javascript, C# (both with .net 2.0 and 3.5 = Web Reference and Service Reference), Visual Basic (with the same) and right now I am working on a NAV 2009 SP1 implementation of the scenario.
We can't hold peoples creativity back just because it is hard to get started...
/FreddyFreddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hello Guys,
Could you please suggest if somebody was able to consume the webservices in SOAP Clients like SOAP-UI .. i am facing the same issue as posted in this thread and wondering how to solve this.
I am using NTLM authentication for these webservice invoke.
Thanks,
Naren0 -
Hi,
We'd also be interested in any final solution to this.
We're trying to consume Nav webservices with Adobe Flex and so far are seeing a simliar error message: "SOAP message is invalid". Working it through SOAPUI, we can see in the log a mention of an authentication problem, even though SOAPUI allows you to enter credentials against it's tests.
We're using the nav services set to NTML authentication, but are begining to think we need some sort of web service proxy. However, all this web stuff is new to us so any help would be appreciated.
Cheers...0 -
We had similar issues and finally seem to have traced it to having whitespace between the opening soap body and message body.
for example this works:
<soap:Body><InboundMessage>
while putting any whitespace or newlines between them results in the "Soap message is invalid!" response from the web service.
for example this results in the error
<soap:Body> <InboundMessage>
Whitespacing\newslines in the rest of the SOAP message seem to make no difference, just on this line.
We are using soap ui(http://sourceforge.net/projects/soapui/ ... oapui/4.0/) for making the web service calls and burp proxy (http://portswigger.net/burp/proxy.html) for the NTLM authentication.
Can anybody confirm this? And can anyone suggest why this might be the case? I can consistently make successful calls without the whitespace and it will succeed, then add whitespace and it fails.... very straing.0 -
Simon79 wrote:Can anybody confirm this? And can anyone suggest why this might be the case? I can consistently make successful calls without the whitespace and it will succeed, then add whitespace and it fails.... very straing.
Hi,
Yes we eventually came to the same conclusion. There is a hotfix available in build 32198
https://mbs2.microsoft.com/Knowledgebas ... US;2510959
I think Freddy's examples stringed the soap requests for his examples into one line hence he didn't suffer the same problem.
For our own problem connecting with Adobe's flex we also had to have a windows service program to host the crossdomain.xml policy file that is required. The file is hosted on the same port as the webservice.
Cheers, Tim0 -
Thanks for the confirmation Tim; we found the same hotfix after diagnosing the issue and it seems to have fixed it for us too.0
-
I finally got SOAPUI to post a request (without installing the hotfix)
1. Remove all line breaks and unneccessary spaces between ><
2. Change the namespace 'soapenv' to 'soap'
Authenticating through NTLM only works when using username, password and domain fields
(by that I mean not using methods like username@domain or domain\username and leaving the domain empty)0 -
A little late, but because it took me some time to find out, my two cents to this problem:
Another way to do so is to let SOAPUI remove the whitespaces:
There is a requestproperty called "Strip Whitespaces", this one should be set to True.0 -
how to call or consume this web service from android
http://username:password@XX.XXX.XX.XXX:7047/DynamicsNAV/WS/androidservice/Page/GetStoredata?wsdl
any help would be appreciated.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


