2010-05-26 26 views
1

我想模仿使用Zend Framework的以下SOAP請求,但我不明白標頭中的'__MethodSignature'部分。有人可以解釋一下嗎?什麼是SOAP頭中的方法簽名?

<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"> 
      xsd:string 
     </h3:__MethodSignature> 
    </SOAP-ENV:Header> 

    <SOAP-ENV:Body> 
    <i4:ReturnDataset id="ref-1" 
     xmlns:i4="http://schemas.microsoft.com/clr/nsassem/Interface.IReturnDataSet/Interface"> 
      <tName id="ref-5">BU</tName> 
     </i4:ReturnDataset> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

當我把這個ReturnDataSet功能是這樣的:

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

服務器拋出一個錯誤。我覺得這個標題部分扮演了一些角色?

回答

2

嘗試設置MethodSignature或__MethodSignature SOAP標頭。對於普通的PHP SOAP客戶端,您可以這樣做:

$client->__setSoapHeaders(new SoapHeader(
    'http://schemas.microsoft.com/clr/soap/messageProperties', 
    '__MethodSignature', 
    'xsd:string' 
)); 
相關問題