Re: [SOAP] PHP5 SOAP not adding namespace to parameters
| From: | Philippe ventrillon | Date: | Fri, 03 Dec 2004 13:30:44 +0000 |
| Subject: | Re: [SOAP] PHP5 SOAP not adding namespace to parameters | ||
| References: | 1 2 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1670@lists.php.net to get a copy of this message | ||
using php 5 i've been able to produce the following request
my message references an element defined in the same wsdl.
The wsdl is built from a sample taken at xmethods.net
Request --------------------------------------------------------------------
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns1="http://www.example.org">
<env:Body>
<ns1:incrementRequest>
<ns1:invalue>20</ns1:invalue>
</ns1:incrementRequest>
</env:Body>
</env:Envelope>
The
wsdl -----------------------------------------------------------------------
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="IBank" targetNamespace=" ...>
<types>
<schema targetNamespace="http://www.xmethods.net/ws-demo/"
xmlns:tns="http://www.xmethods.net/ws-demo/"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="chargeRequest">
<xs:complexType>
<xs:sequence>
<xs:element
name="customerID" type="xs:string"/>
<xs:element name="amount"
type="xs:float"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chargeResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Result"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</schema>
</types>
<message name="charge0SoapIn">
<part name="chargeRequest" element="tns:chargeRequest"/>
</message>
<message name="charge0SoapOut">
<part name="chargeResponse" element="tns:chargeResponse"/>
</message>
<portType name="IBankSoap">
<operation name="charge">
<input name="charge0SoapIn"
message="tns:charge0SoapIn"/>
<output name="charge0SoapOut"
message="tns:charge0SoapOut"/>
</operation>
</portType>
<binding name="IBankSoap" type="tns:IBankSoap">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="charge">
<soap:operation soapAction="" style="document"/>
<input name="charge0SoapIn">
<soap:body use="literal"/>
</input>
<output name="charge0SoapOut">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name='ChargeService'>
<port name='ChargePort' binding='IBankSoap'>
<soap:address location='http://localhost/server.php'/>
</port>
</service>
</definitions>
Hope it helps
--
Philippe
"Marius Mathiesen" <marius@disputable.org> wrote in message
news:31192.194.248.132.244.1102069192.squirrel@194.248.132.244...
> > Why doesn't PHP5 add the "ns4" namespace to the parameters ? Is there a
> > way to force it to ?
>
> Well, it does - kind of.
> You see that PHP5 assigns the namespace to ns1
>
> xmlns:ns1="TCOL_MATRIX"
>
> not ns4. This means that ns4 in the PEAR sample is equivalent to ns1 in
> the PHP5 example. Further, where PHP5 states that Addr_Map relates to this
> namespace (TCOL_MATRIX), it logically follows that the tags within
> <Addr_Map> belong to the same namespace:
>
> <ns1:Addr_Map>
>
> To me it seems PHP5 works correctly. However, this may not be very helpful
> if your application doesn't work. Sorry about that :-)
>
> Regards, Marius