[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-soap
Subject:    [SOAP] Class based method overloading
From:       83.72.35.34
Date:       2007-07-17 20:20:27
Message-ID: FD.B1.05050.FA42D964 () pb1 ! pair ! com
[Download RAW message or body]

Hi,

I have a WSDL that uses method overloading, but it seems not possible to
distinguish in a class. The WSDL targets functions like:

  getSupSet(userClass)
  getSupSet(userClass, typeClass)
  getSupSet(userClass, deviceClass)
  getSupSet(userClass, typeClass, deviceClass)

The WSDL used distinct input and output targets for the same operation
name per specification (only 2 methods shown):
....
<wsdl:portType name="MyServer">
 <wsdl:operation name="getSupSet" parameterOrder="user">
  <wsdl:input message="impl:getSupSetReq" name="getSupSetReq"/>
  <wsdl:output message="impl:getSupSetResp" name="getSupSetResp"/>
 </wsdl:operation>
  <wsdl:operation name="getSupSet1" parameterOrder="user device">
  <wsdl:input message="impl:getSupSetReq1" name="getSupSetReq1"/>
  <wsdl:output message="impl:getSupSetResp1" name="getSupSetResp1"/>
 </wsdl:operation>
 ...
</wsdl:portType>
<wsdl:binding name="MySoapBinding" type="impl:MyServer">
 <wsdl:operation name="getSupSet">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="getSupSetReq">
   <wsdlsoap:body encodingStyle="..." namespace="..." use="encoded"/>
  </wsdl:input>
  <wsdl:output name="getSupSetResp">
   <wsdlsoap:body encodingStyle="..." namespace="..." use="encoded"/>
  </wsdl:output>
 </wsdl:operation>
 <wsdl:operation name="getSupSet">
  <wsdlsoap:operation soapAction=""/>
  <wsdl:input name="getSupSetReq1">
   <wsdlsoap:body encodingStyle="..." namespace="..." use="encoded"/>
  </wsdl:input>
  <wsdl:output name="getSupSetResp1">
   <wsdlsoap:body encodingStyle="..." namespace="..." use="encoded"/>
  </wsdl:output>
 </wsdl:operation>
 ...
</wsdl:binding>
....

The following class spec gives an error that the function is redefined
(PHP 5.1.6):
class MyServer {
 function getSupportedSettings($userClass) {}
 function getSupportedSettings($userClass, $typeClass) {}
 function getSupportedSettings($userClass, $deviceClass) {}
 function getSupportedSettings($userClass, $typeClass, $deviceClass) {}
 ...
}

I tried to define only one function with three (complexType) arguments
(the last) because I can tell the calls apart from the argument content,
but calling the server resulted in missing arguments. The second and
third argument never were set to anything, regardless of the client-call.


Is it possible to build a PHP class that can distinguish these
method-calls/functions, or any other way (besides hacking the request
content at runtime)?


--
Greetings Bertho

(disclaimers are disclaimed)

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic