SOAP标头中的方法签名是什么?

时间:2010-05-26 16:46:16

标签: php web-services zend-framework soap

我想使用Zend Framework模仿以下SOAP请求,但我不理解标题中的'__ MethodSignature'部分。有人可以解释一下吗?

<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);

服务器抛出错误。我认为这个标题部分正在扮演一些角色?

1 个答案:

答案 0 :(得分:2)

尝试设置MethodSignature或__MethodSignature SOAP标头。使用普通的PHP SOAP客户端,您可以按如下方式执行此操作:

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