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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux