xml string WITH special chars into SoapHeader constructor

liunx

Guest
I'm trying to add a SOAP Header to a SoapClient object...
$client = new SoapClient("http://ws.strikeiron.com/TaxDataComplete?WSDL", array("trace"=>1));
$licenseHeader = new SoapHeader('http://www.strikeiron.com','LicenseInfo', '<ns1:LicenseKey>OUR_TRIAL_KEY</ns1:LicenseKey>');
but when I call the SOAP service...
$returnXML = $client->__soapCall("GetUSATaxRatesByZipCode", array('zipCode'=>'74133'), NULL, $licenseHeader);
and look at the SOAP Request that was sent, it sent:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.strikeiron.com"><SOAP-ENV:Header><ns1:LicenseInfo><ns1:LicenseKey>OUR_TRIAL_KEY</ns1:LicenseKey></ns1:LicenseInfo></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetUSATaxRatesByZipCode/></SOAP-ENV:Body></SOAP-ENV:Envelope>
which is no good. it's replace <ns1:LicenseKey> with the escapes for those special characters.
and setting the header data xml to a string variable...

$client = new SoapClient("http://ws.strikeiron.com/TaxDataComplete?WSDL", array("trace"=>1));
$strLicenseXML = '<ns1:LicenseKey>OUR_TRIAL_KEY</ns1:LicenseKey>';
$licenseHeader = new SoapHeader('http://www.strikeiron.com','LicenseInfo', $strLicenseXML);
$returnXML = $client->__soapCall("GetUSATaxRatesByZipCode", array('zipCode'=>'74133'), NULL, $licenseHeader);

has the same problem, even though

print $strLicenseXML;

will print the xmlString without replacing any of the special characters (what I want!)

how can I get the SoapHeader object built WITH the special characters - the way the print command displays the string?
 
Back
Top