SitePoint Sponsor |
|
User Tag List
Results 1 to 1 of 1
-
May 4, 2005, 07:01 #1
- Join Date
- Sep 2002
- Posts
- 5
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
xml-rpc server and failing client soap request
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:
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="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" > <!-- Types for search - result elements, directory categories --> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 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="http://schemas.xmlsoap.org/soap/http"/> <operation name="method_call_in_question"> <soap:operation style="rpc" soapAction="urn:SODAction"/> <input> <soap:body use="encoded" namespace="urn:SOD" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:SOD" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <!-- Endpoint--> <service name="SODService"> <port name="SODPort" binding="typens:SODBinding"> <soap:address location="https://dev.endpoint.com/ws/"/> </port> </service> </definitions>
Unsuccessful Request: - fault string is: server error. method not found.
===============================
Code:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:SOD" xmlns:types="urn:SOD/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:SOD" xmlns:types="urn:SOD/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <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>
Bookmarks