在nuSOAP中,如何返回多次出现的简单数据类型作为响应?

发布于 2024-10-18 13:36:13 字数 386 浏览 2 评论 0原文

假设我的响应消息可以像这样

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

this (xsd:string) 项目多次出现。

如何在nuSOAP服务器中添加和配置这种响应消息?

提前致谢 :)

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:string) item is having multiple occurance.

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

Thanks in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷清清 2024-10-25 13:36:13

我在另一个论坛上找到了这个例子。它帮助我解决了多个元素的类似问题:

<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 采用重复的“car”是一个数组的方法,因此
关联数组中的“car”元素指向一个简单数组:

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


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

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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文