help me plz..type matching not happening
| From: | Noé Amorim | Date: | Thu, 09 Nov 2006 16:01:21 +0000 |
| Subject: | help me plz..type matching not happening | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-2390@lists.php.net to get a copy of this message | ||
Hello.
I'm doing a small example of an webservice using a self-generated
using a script by Katy Coe.
i'll post the wsdl file, the request and response from client and server.
WSDL:
<?xml version="1.0"?>
<definitions name="ServiceBooks" targetNamespace="urn:ServiceBooks"
xmlns:tns="urn:ServiceBooks" xmlns:impl="urn:ServiceBooks"
xmlns:xsd1="urn:ServiceBooks"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types xmlns="http://schemas.xmlsoap.org/wsdl/">
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:ServiceBooks">
<complexType name="ArrayOfBook"><sequence> <element name="Book" type="tns:Book" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType>
<complexType name="Book">
<sequence>
<element name="b_title" type="xsd:string"/>
<element name="b_author" type="xsd:string"/>
<element name="b_isdn" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</types>
<portType name="ServiceBooksPortType">
<operation name="getBooks">
<input message="tns:GetBooksRequest"/>
<output message="tns:GetBooksResponse"/>
</operation>
</portType>
<binding name="ServiceBooksBinding" type="tns:ServiceBooksPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getBooks">
<soap:operationsoapAction="urn:ServiceBooks#ServiceBooksServer#getBooks"/>
<input>
<soap:body use="encoded" namespace="urn:ServiceBooks"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body parts="return" use="encoded"
namespace="urn:ServiceBooks"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output></operation> </binding> <message name="GetBooksRequest"/> <message name="GetBooksResponse"> <part name="return" type="tns:ArrayOfBook"/> </message> <service name="ServiceBooksService"> <port name="ServiceBooksPort" binding="tns:ServiceBooksBinding">
<soap:address location="http://localhost/interacesso/endpoint2.php"/></port> </service> </definitions> Request: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ServiceBooks" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:getBooks/> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ServiceBooks" 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/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body><ns1:getBooksResponse> <return xsi:type="ns1:ArrayOfBook"> <Book xsi:type="ns1:Book"> <b_title xsi:type="xsd:string">B1</b_title> <b_author xsi:type="xsd:string">Author1</b_author> <b_isdn xsi:type="xsd:string">ISDN1</b_isdn> </Book> <Book xsi:type="ns1:Book"> <b_title xsi:type="xsd:string">B2</b_title> <b_author xsi:type="xsd:string">Author2</b_author> <b_isdn xsi:type="xsd:string">ISDN2</b_isdn> </Book> <Book xsi:type="ns1:Book"> <b_title xsi:type="xsd:string">B3</b_title> <b_author xsi:type="xsd:string">Author3</b_author> <b_isdn xsi:type="xsd:string">ISDN3</b_isdn> </Book> </return> </ns1:getBooksResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> with this, can someone explain to me why i get "Looks like we have no XML document" ? if someone needs more details, feel free to ask. thanks.