views:

95

answers:

1

I want to imitate the following SOAP request using Zend Framework but I don't understand the '__MethodSignature' part in header. Could someone please explain this?

<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/"&gt;
    <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"&gt;
            <tName id="ref-5">BU</tName>
        </i4:ReturnDataset>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

When I call this ReturnDataSet function like this:

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

Server throws an error. I think this header part is playing some role?

+1  A: 

Try setting the MethodSignature or __MethodSignature SOAP header. With the normal PHP SOAP client, you do this as follows:

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