我需要进行soap调用,其中包括这样的头:
<soap:Header>
<Agency xmlns="http://schemas.costacrociere.com/WebAffiliation">
<Code>1111</Code>
<Culture />
</Agency>
<Partner xmlns="http://schemas.costacrociere.com/WebAffiliation">
<Name>AAAA</Name>
<Password>XXXX</Password>
</Partner>
</soap:Header>
如何使用SoapClient在PHP中做到这一点?Plz帮助:)
我做到了:
$ns="http://schemas.costacrociere.com/WebAffiliation";
//Body of the Soap Header.
$headerbody1 = array("Name" => "AAAA", "Password" => "XXXX");
$headerbody2 = array("Code" => "1111");
//Create Soap Header.
$header[] = new SOAPHeader($ns, 'Partner', $headerbody1);
$header[] = new SOAPHeader($ns, 'Agency', $headerbody2);
//set the Headers of Soap Client.
$client->__setSoapHeaders($header);