1

Nusoap で SOAP サーバーを構築しました。メソッドの 1 つが次のようなものを返しました。

<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>
...

今、私は Zend Soap に切り替えましたが、応答を上記のようにすることはできません。私が得た最も近いものは次のようなものでした:

<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 の自動検出機能を使用しており、以下の 2 つのクラスが関係しています。

class SelectResponse
{
    /** @var SelectItem[] */
    public $items;
}

class SelectItem
{
    /** @var int */
    public $id;

    /** @var string */
    public $name;

}

Zend_Soap を使用して Nusoap を使用した場合と同様の応答を得るにはどうすればよいでしょうか?

4

0 に答える 0