开发者

How to send hashed data in SOAP request body?

I want to imitate following request using 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:stri开发者_如何学JAVAng 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>

It seems somehow I've to send hashed "ref-7" and "ref-8" array embedded inside body? How can I do this?

Function ReturnDataSet takes two parameters, how can I send additional "ref-7" and "ref-8" array data?

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

I don't know how to set $ht, so that hashed data is sent as different body entry.

Thanks.


have you tried sending a two-dimensional array as $ht? From looking at the code, $ht corresponds to a hashtable with ref-7 and ref-8 being an array themselves.

I tried to open this service in Visual Studio to get an idea of the type of parameters, but I recieved a few schema errors, mainly missing dataTypes. Are you sure this web service is configured and working like it should for others?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜