[wsf-c-dev] [PHP] WSService API additions
Samisa Abeysinghe
samisa at wso2.com
Mon Feb 12 21:13:33 PST 2007
James Clark wrote:
> On Tue, 2007-02-13 at 10:30 +0600, Samisa Abeysinghe wrote:
>
>>>> In non-WSDL case, how are we to get to know the format of the payload to
>>>> be prepared?
>>>>
>>>>
>>> I don't understand the question. Could you step me through the scenario
>>> you are asking about?
>>>
>>>
>> Let me give an example.
>>
>> Say that we want the response payload to look something like the following:
>> <ns1:addResponse>
>> <addReturn xsi:type="xsd:int">120</addReturn>
>> </ns1:addResponse>
>>
>> Now I could write the add function like the following with SOAP ext:
>>
>> function add($param1, $param2) {
>> $result = new SoapParam($param1 + $param2, "addReturn");
>> return $result;
>> }
>>
>> My question is, how to support such a scenario?
>>
>
> By extending the WSMethodSignature object I described a while back so
> that it can specify the element names used not only for the parameters
> but also for the return value.
>
The example you have given was:
$addSignature = new WSMethodSignature("a", "b")
$add.returnType = "xs:int"
$add.paramTypes = array("xs:int", "xs:int")
...
"methods" => array("add" => $addSignature)
I suppose we need to add returnName attribute to WSMethodSignature.
Also, if signature spec is not given, we can assume defaults.
In case of wrapping SoapParam, one of the challenges is that, SoapParam
could be constructed within the user function. So I am wondering how we
could make use WSMethodSignature to support SoapParam.
Samisa...
More information about the Wsf-c-dev
mailing list