Ok, this question might cross some lines with php, soap and/or xml, but here we go.
I have setup an xml-rpc server with php. I've also created a wsdl to define the webservice calls. Many web service clients can consume the wsdl and make calls to the service which the xml-rpc server can handle. However, a .NET client composes it's soap envelope in such a way that the xml-rpc server misinterprets it. The reason the xml-rpc server cannot correctly interpret is is because of these soap envelope tags that the .NET client composes:
the server is expecting:
and I've tested that fact. So my questions are, is the server incorrect in that it is restricted to those tags only around the envelope. Or, should the client be composing the request with the SOAP-ENV tags. Or, should my wsdl be formatted in a way so that the client knows it needs to use the SOAP-ENV tags (wsdl follows). I've seen many soap messages composed both ways and both ways are indicated to be 'correct'.
=============================
wsdl
=============================
===============================
Unsuccessful Request: - fault string is: server error. method not found.
===============================
============================================
Successful Request - only change is SOAP-ENV
============================================
Thanks for any tips and suggestions.
I have setup an xml-rpc server with php. I've also created a wsdl to define the webservice calls. Many web service clients can consume the wsdl and make calls to the service which the xml-rpc server can handle. However, a .NET client composes it's soap envelope in such a way that the xml-rpc server misinterprets it. The reason the xml-rpc server cannot correctly interpret is is because of these soap envelope tags that the .NET client composes:
Code:
<soap:Envelope....>.....</soap:Envelope>
Code:
<SOAP-ENV:Envelope....>....</SOAP-ENV:Envelope>
=============================
wsdl
=============================
Code:
<?xml version="1.0"?>
<definitions name="SOD"
targetNamespace="urn:SOD"
xmlns:typens="urn:SOD"
xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL]
xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/wsdl/soap/"[/URL]
xmlns:soapenc="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL]
xmlns:wsdl="[URL unfurl="true"]http://schemas.xmlsoap.org/wsdl/"[/URL]
xmlns="[URL unfurl="true"]http://schemas.xmlsoap.org/wsdl/"[/URL] >
<!-- Types for search - result elements, directory categories -->
<types>
<xsd:schema xmlns="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL]
targetNamespace="urn:SOD">
<xsd:complexType name="SODSearchResult">
<xsd:all>
<xsd:element name="documentFiltering" type="xsd:boolean"/>
<xsd:element name="searchComments" type="xsd:string"/>
<xsd:element name="estimatedTotalResultsCount" type="xsd:int"/>
<xsd:element name="estimateIsExact" type="xsd:boolean"/>
<xsd:element name="resultElements" type="typens:ResultElementArray"/>
<xsd:element name="searchQuery" type="xsd:string"/>
<xsd:element name="startIndex" type="xsd:int"/>
<xsd:element name="endIndex" type="xsd:int"/>
<xsd:element name="searchTips" type="xsd:string"/>
<xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/>
<xsd:element name="searchTime" type="xsd:double"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ResultElement">
<xsd:all>
<xsd:element name="summary" type="xsd:string"/>
<xsd:element name="URL" type="xsd:string"/>
<xsd:element name="snippet" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="cachedSize" type="xsd:string"/>
<xsd:element name="relatedInformationPresent" type="xsd:boolean"/>
<xsd:element name="hostName" type="xsd:string"/>
<xsd:element name="directoryCategory" type="typens:DirectoryCategory"/>
<xsd:element name="directoryTitle" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ResultElementArray">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DirectoryCategoryArray">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DirectoryCategory">
<xsd:all>
<xsd:element name="fullViewableName" type="xsd:string"/>
<xsd:element name="specialEncoding" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<!-- Messages Web APIs -->
<message name="method_call_in_question">
<part name="username" type="xsd:string"/>
<part name="password" type="xsd:string"/>
<part name="xid" type="xsd:string"/>
</message>
<message name="method_call_in_questionResponse">
<part name="return" type="xsd:base64Binary"/>
</message>
<!-- Port Web APIs, "SOD" -->
<portType name="SODPort">
<operation name="method_call_in_question">
<input message="typens:method_call_in_question"/>
<output message="typens:method_call_in_questionResponse"/>
</operation>
</portType>
<!-- Binding for Web APIs - RPC, SOAP over HTTP -->
<binding name="SODBinding" type="typens:SODPort">
<soap:binding style="rpc" transport="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/http"/>[/URL]
<operation name="method_call_in_question">
<soap:operation style="rpc" soapAction="urn:SODAction"/>
<input>
<soap:body use="encoded"
namespace="urn:SOD"
encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"/>[/URL]
</input>
<output>
<soap:body use="encoded"
namespace="urn:SOD"
encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"/>[/URL]
</output>
</operation>
</binding>
<!-- Endpoint-->
<service name="SODService">
<port name="SODPort" binding="typens:SODBinding">
<soap:address location="[URL unfurl="true"]https://dev.endpoint.com/ws/"/>[/URL]
</port>
</service>
</definitions>
Unsuccessful Request: - fault string is: server error. method not found.
===============================
Code:
<soap:Envelope
xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL]
xmlns:soapenc="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL]
xmlns:tns="urn:SOD" xmlns:types="urn:SOD/encodedTypes"
xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL]
xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
<soap:Body soap:encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/">[/URL]
<tns:method_call_in_question>
<username xsi:type="xsd:string">user</username>
<password xsi:type="xsd:string">pass</password>
<xid xsi:type="xsd:string">id</xid>
</tns:method_call_in_question>
</soap:Body>
</soap:Envelope>
Successful Request - only change is SOAP-ENV
============================================
Code:
<SOAP-ENV:Envelope
xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL]
xmlns:soapenc="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL]
xmlns:tns="urn:SOD" xmlns:types="urn:SOD/encodedTypes"
xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL]
xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
<soap:Body soap:encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/">[/URL]
<tns:method_call_in_question>
<username xsi:type="xsd:string">user</username>
<password xsi:type="xsd:string">pass</password>
<xid xsi:type="xsd:string">id</xid>
</tns:method_call_in_question>
</soap:Body>
</SOAP-ENV:Envelope>
Thanks for any tips and suggestions.