开发者

In nuSOAP, how to return simple data type having multiple occurance as response?

Suppose my response message can be like this

<Response> 
<ResponseCode>false</ResponseCode> 
<ResponseMessage>reason 1</ResponseMessage> 
<ResponseMessage>reason 2</ResponseMessage> 
<ResponseMessage>reason 3</ResponseMessage> 
</Response> 

this (xsd:s开发者_StackOverflow社区tring) item is having multiple occurance.

How to add and configure this kind of rsponse message in nuSOAP server?

Thanks in advance :)


I found this example on another forum. It helped me solving a similar issue with multiple elements:

<inventory>
    <car>
        <make>Nissan</make>
        <model>Maxima</model>
        <year>2005</year>
        <quantity>3</quantity>
    </car>
    <car>
        <make>Nissan</make>
        <model>Maxima</model>
        <year>2006</year>
        <quantity>1</quantity>
    </car>
</inventory>

NuSOAP takes the approach that "car", which is repeated, is an array, so the "car" element in the associative array points to a simple array:

$car[] = array('make' => 'Nissan', 'model' => 'Maxima', 'year' => 2005, 
'quantity' => 3);
$car[] = array('make' => 'Nissan', 'model' => 'Maxima', 'year' => 2006, 
'quantity' => 1);


$inventory = array('car' => $car);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜