Re: [SOAP] Web service with several operations : only the first one works

From: Date: Thu, 09 Jun 2005 13:47:00 +0000
Subject: Re: [SOAP] Web service with several operations : only the first one works
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-1932@lists.php.net to get a copy of this message
On Jun 9, 2005, at 8:21 AM, LEBUR Guillaume wrote:
Thanks for your answers. George> Yes, it's in doc/lit mode. I'm okay with setting different input types for the two methods so that the server can tell the difference between them, but where do I have to change things ? In the wsdl, client, server or all three ?
Just in the wsdl.
PHP being a weakly-typed language, how will the server tell the type of the parameter sent by the client ?
It's not actually the PHP/zval 'type', it's the the type name as it is serialized according to the wsdl rule. Thus if you have something like: <message name='EchoRequest'> <part name='body' element="tns:SOAPStruct"/> </message> <message name='EchoResponse'> <part name='return' element="tns:SOAPStruct"/> </message> <message name='EchoStringRequest'> <part name='body' element="tns:EchoStringType"/> <part name='header' element="tns:credentials"/> </message> <message name='EchoStringResponse'> <part name='return' type='xsd:string'/> </message> <portType name='EchoStringPortType'> <operation name='EchoString'>
    <input message='tns:EchoStringRequest'/>
    <output message='tns:EchoStringResponse'/>
</operation> <operation name='EchoAny'>
    <input message='tns:EchoRequest'/>
    <output message='tns:EchoResponse'/>
</operation> </portType> That will work fine, but this: <message name='EchoRequest'> <part name='body' element="tns:SOAPStruct"/> </message> <message name='EchoResponse'> <part name='return' element="tns:SOAPStruct"/> </message> <message name='EchoStringRequest'> <part name='body' element="tns:EchoStringType"/> <part name='header' element="tns:credentials"/> </message> <message name='EchoStringResponse'> <part name='return' type='xsd:string'/> </message> <portType name='EchoStringPortType'> <operation name='EchoString'>
    <input message='tns:EchoRequest'/>
    <output message='tns:EchoResponse'/>
</operation> <operation name='EchoAny'>
    <input message='tns:EchoRequest'/>
    <output message='tns:EchoResponse'/>
</operation> </portType> will not (only the first operation, EchoString, will get picked up). That having been said, your wsdl looks like it conforms with this rule. Just for giggles, can you try dropping this from your wsdl and see if it helps: soap:operation soapAction="urn:cms#getGroupes" style="document"/> George

« previous php.soap (#1932) next »