如何在SOAP请求体中发送散列数据?

时间:2010-05-24 13:13:20

标签: php web-services soap

我想使用Zend_Soap_Client模仿以下请求。

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <SOAP-ENV:Header>
<h3:__MethodSignature xsi:type="SOAP-ENC:methodSignature" 
xmlns:h3="http://schemas.microsoft.com/clr/soap/messageProperties" SOAP-ENC:root="1"
xmlns:a2="http://schemas.microsoft.com/clr/ns/System.Collections">xsd:string a2:Hashtable</h3:__MethodSignature>
 </SOAP-ENV:Header>

 <SOAP-ENV:Body>
  <i4:ReturnDataSet id="ref-1" xmlns:i4="http://schemas.microsoft.com/clr/nsassem/Interface.IRptSchedule/Interface">
   <sProc id="ref-5">BU</sProc>
   <ht href="#ref-6"/>
  </i4:ReturnDataSet><br/>

  <a2:Hashtable id="ref-6" xmlns:a2="http://schemas.microsoft.com/clr/ns/System.Collections">
   <LoadFactor>0.72</LoadFactor>
   <Version>1</Version>
   <Comparer xsi:null="1"/>
   <HashCodeProvider xsi:null="1"/>
   <HashSize>11</HashSize>
   <Keys href="#ref-7"/>
   <Values href="#ref-8"/>
  </a2:Hashtable>

  <SOAP-ENC:Array id="ref-7" SOAP-ENC:arrayType="xsd:anyType[1]">
   <item id="ref-9" xsi:type="SOAP-ENC:string">@AppName</item>
  </SOAP-ENC:Array><br/>

  <SOAP-ENC:Array id="ref-8" SOAP-ENC:arrayType="xsd:anyType[1]">
   <item id="ref-10" xsi:type="SOAP-ENC:string">AAGENT</item>
  </SOAP-ENC:Array>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

似乎某种程度上我要发送嵌入体内的散列“ref-7”“ref-8”数组?我怎么能这样做?

函数 ReturnDataSet 有两个参数,如何发送额外的“ref-7”“ref-8”数组数据?< / p>

$client = new SoapClient($wsdl_url, array('soap_version' => SOAP_1_1));
$result = $client->ReturnDataset("BU", $ht);

我不知道如何设置 $ ht ,以便将散列数据作为不同的正文条目发送。

感谢。

1 个答案:

答案 0 :(得分:0)

你试过发送一个二维数组作为$ ht吗?从查看代码开始,$ ht对应一个带有ref-7的散列表,ref-8就是一个数组本身。

我尝试在Visual Studio中打开此服务以了解参数类型,但我收到了一些架构错误,主要是缺少dataTypes。您确定此Web服务已配置并且正如其他人一样工作吗?

相关问题