Problem with calling .Net Web Service. XML provided. Anyone help?

S

Stewart

Hi,

I'm hoping that someone will be able to help out with a problem we are
having. We have a web service built in .Net 1.1. We are trying to
call it from PHP4 using the NuSOAP add on. It seems the SOAP it is
sending as the request isn't what the web service is looking for.

Here is what my PHP4 NuSOAP client is sending:

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:tns="https://mysite.com/mydir/WebService/">
<SOAP-ENV:Body>
<MyFunction xsi:type="xsd:string">08</MyFunction>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Here is what my .Net 1.1 web service expects the request to look like:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="https://mysite.com/mydir/WebService/"
xmlns:types="https://mysite.com/mydir/WebService/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:GetMessage>
<MyFunction xsi:type="xsd:string">08</MyFunction>
</tns:GetMessage>
</soap:Body>
</soap:Envelope>

On the request a SOAP fault is raised with the message:

<faultstring>Server was unable to read request. --&gt; There is an
error in XML document (1, 399). --&gt; &amp;lt;MerchantResponse
xmlns=''&amp;gt; was not expected.</faultstring>

Does anyone have any idea exactly which xmlns shouldn't be sent, or
what the problem is?

Many thanks,

Stewart
 
D

DC

I can see that the request generated by PHP is not wrapping the <MyFunction>
element in a <GetMessage> element.

That looks to be the primary difference. That would account for the
rejection you are getting.

Does the nuSOAP generate stubs from WSDL ?

Also, look into WS-I BP1.0 compliant webservices, including using
document/literal. You appear to be using RPC/Encoded, which is not good for
interoperability.

-D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top