首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在SOAP请求体中发送散列数据?

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

Stack Overflow用户
提问于 2010-05-24 13:13:20
回答 1查看 797关注 0票数 1

我想使用Zend_Soap_Client来模拟下面的请求。

代码语言:javascript
复制
<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"数组数据?

代码语言:javascript
复制
$client = new SoapClient($wsdl_url, array('soap_version' => SOAP_1_1));
$result = $client->ReturnDataset("BU", $ht);

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

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2010-06-02 11:31:24

你试过以$ht的形式发送二维数组吗?从代码来看,$ht对应于一个哈希表,其中ref-7和ref-8本身就是一个数组。

我试图在Visual中打开这个服务,以了解参数的类型,但我收到了一些模式错误,主要是缺少dataTypes。您确定此web服务是配置好的,并按照其他人的要求工作吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2897194

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档