hunghit
(Littleboy 49)
July 23, 2012, 9:18pm
1
I am writing a web service (server side) based on API spec of other party.
The problem: when I want to return multiple field, the soap controller always return a root struct with childs are my fields.
Client request:
<urn:request>
<request xsi:type="xsd:string">anc</request>
<requestSignature xsi:type="xsd:string">ac</requestSignature>
</urn:request>
My server response:
<ns1:requestResponse>
<return xsi:type="SOAP-ENC:Struct">
<response xsi:type="xsd:string">SUCCESS</response>
<responseSignature xsi:type="xsd:string">abc</responseSignature>
</return>
</ns1:requestResponse>
What i want:
<ns1:requestResponse>
<response xsi:type="xsd:string">SUCCESS</response>
<responseSignature xsi:type="xsd:string">abc</responseSignature>
</ns1:requestResponse>
Currently in soap controller i return an object {response,responseSignature}
My soapcontroller was declare with:
/**
*/
public function request($request,$requestSignature) {}
How i modify to return without the "return" tag?
Thanks,
Hung
hunghit
(Littleboy 49)
July 24, 2012, 4:36am
2
i see that cannot remove it because it hard code in CWsdlGenerator at line 152
$this->_messages[$methodName.‘Response’]=array(‘return’=>$return);
I dont know how to modify it parsing and it should not modify the core so it let it as is. I will find another library or write php soap directly.
hunghit:
I am writing a web service (server side) based on API spec of other party.
The problem: when I want to return multiple field, the soap controller always return a root struct with childs are my fields.
Client request:
<urn:request>
<request xsi:type="xsd:string">anc</request>
<requestSignature xsi:type="xsd:string">ac</requestSignature>
</urn:request>
My server response:
<ns1:requestResponse>
<return xsi:type="SOAP-ENC:Struct">
<response xsi:type="xsd:string">SUCCESS</response>
<responseSignature xsi:type="xsd:string">abc</responseSignature>
</return>
</ns1:requestResponse>
What i want:
<ns1:requestResponse>
<response xsi:type="xsd:string">SUCCESS</response>
<responseSignature xsi:type="xsd:string">abc</responseSignature>
</ns1:requestResponse>
Currently in soap controller i return an object {response,responseSignature}
My soapcontroller was declare with:
/**
*/
public function request($request,$requestSignature) {}
How i modify to return without the "return" tag?
Thanks,
Hung
hunghit
(Littleboy 49)
July 24, 2012, 5:08am
3
Finally i find out this is not the requirement as soap client will map whatever struc name return, so keep it as is and working. Sorry for my stupid question.