Php Zend_Soap返回数组
我在Nusoap上构建了一个Soap服务器。其中一个方法返回如下内容:Php Zend_Soap返回数组,php,web-services,zend-framework,nusoap,zend-soap,Php,Web Services,Zend Framework,Nusoap,Zend Soap,我在Nusoap上构建了一个Soap服务器。其中一个方法返回如下内容: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://test.webservice/soap/">
<SOAP-ENV:Body>
<ns1:get_itemsResponse xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:SelectItem[18]">
<item xsi:type="tns:SelectItem">
<id xsi:type="xsd:int">6</id>
<name xsi:type="xsd:string">This is the first item</name>
</item>
<item xsi:type="tns:SelectItem">
<id xsi:type="xsd:int">7</id>
<name xsi:type="xsd:string">This is another item</name>
</item>
...
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://another.webservice/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:get_ItemsResponse>
<return xsi:type="ns1:SelectResponse">
<items SOAP-ENC:arrayType="ns1:SelectItem[18]" xsi:type="ns1:ArrayOfSelectItem">
<item xsi:type="ns1:SelectItem">
<id xsi:type="xsd:int">6</id>
<name xsi:type="xsd:string">This is the first item</name>
</item>
<item xsi:type="ns1:SelectItem">
<id xsi:type="xsd:int">7</id>
<name xsi:type="xsd:string">This is another item</name>
</item>
...
您知道如何使用Zend_Soap获得与使用Nusoap类似的响应吗?我假设您试图使
Zend_Soap_服务器
响应与thNusoap
响应相同,因为客户端在尝试处理来自服务器的响应时抛出某种错误?如果是这样的话,会抛出什么错误?@Zorrocaesar你有什么收获吗?
class SelectResponse
{
/** @var SelectItem[] */
public $items;
}
class SelectItem
{
/** @var int */
public $id;
/** @var string */
public $name;
}