phpsoap客户端如何发送多维数组复杂类型


php soap client how to send multi-dimentional array complex type?

这是我目前想要生成的xml我希望每个标签和标签信息都被每个标签的xml标签包围,问题是我从数据库中获取任意数量的列表,并需要将此列表传递到
soap客户端?请有人帮我一下,谢谢

这是我在下面需要的

 <ns1:sendListRequest><ns1:updateType>FULL</ns1:updateType>   
<ns1:listVersion>1</ns1:listVersion><ns1:AuthorisationList> 
<ns1:Tag>tag1</ns1:Tag><ns1:Taginfo>web example</ns1:Taginfo>   
<ns1:Tag>tag2</ns1:Tag><ns1:Taginfo>web  example2</ns1:Taginfo> 
  </ns1:AuthorisationList></ns1:sendListRequest></env:Body></env:Envelope> 
 this what I get <ns1:Tag>tag1tag2</ns1:Tag> which is probably expected from array  I'm using
  soap request 
   while ($row = $db->getResult()) {
   $tags[] = $row['tags'];
 }

 $tags=implode($list);
 $response = $client->SendList(array('updateType' => 
 $updatetype,'listVersion'  =>     $listversion,'AuthorisationList' =>  
 array('Tag' => $tags, 'Taginfo' => $taginfo));      

WSDL文件

    <s:complexType name="SendListRequest">
    <s:annotation>
      <s:documentation>Defines the SendList.req PDU</s:documentation>
    </s:annotation>
    <s:sequence>
      <s:element name="updateType" type="tns:UpdateType" minOccurs="1" maxOccurs="1" />
      <s:element name="listVersion" type="s:int" minOccurs="1" maxOccurs="1" />
     <s:element name="AuthorisationList" type="tns:AuthorisationData" minOccurs="0" maxoccurs="unbounded">
            </s:sequence>
   </s:complexType>
   <s:element name="sendListRequest" type="tns:SendListRequest" />
  <s:element name="sendListResponse" type="tns:SendListResponse" />
  </s:schema>
 </wsdl:types>
    <wsdl:message name="SendListInput">
<wsdl:part name="parameters" element="tns:sendListRequest" />
   </wsdl:message>
   <wsdl:message name="SendListOutput">
<wsdl:part name="parameters" element="tns:sendListResponse" />
 </wsdl:message>
  <wsdl:portType name="Service">
   <wsdl:operation name="SendList">
  <wsdl:input message="tns:SendListInput" wsaw:Action="/SendList" />
  <wsdl:output message="tns:SendListOutput" wsaw:Action="/SendListResponse" />
  </wsdl:operation>
  </wsdl:portType>

    <s:complexType name="AuthorisationData">
    <s:sequence>
      <s:element name="Tag" type="tns:IdToken" minOccurs="1" maxOccurs="1"/>
      <s:element name="TagInfo" type="tns:TagInfo" minOccurs="0" maxOccurs="1"/>
    </s:sequence>
  </s:complexType>
  <s:simpleType name="UpdateType">
    <s:restriction base="s:string">
      <s:enumeration value="Different"/>
      <s:enumeration value="Full"/>
    </s:restriction>
  </s:simpleType>
  <wsdl:service name="Service">
  <wsdl:documentation></wsdl:documentation>
  <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap">
  <soap12:address location="http://Service/" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

就我从WSDL中看到的而言,授权列表是一个授权数据序列,它本身是一个包含Tag和TagInfo的数组,所以我认为您的数组结构必须如下所示:

$toSend = array(
    'updateType' => $updatetype,
    'listVersion'  => $listversion,
    'AuthorisationList' => array(
        'AuthorisationData'=> array()
    )
);
// and this could be a way to add your db results:
while ($row = $db->getResult()) {
    // I can't see where you get the TagInfo from.
    $toSend['AuthorisationData'][] = array(
        'Tag'=>$row['tags'],
        'TagInfo'=> ? 
    ); 
}