Jump to content

PEAR::SOAP header problem


dfowler

Recommended Posts

Hey guys, here is my problem.  I need to send this:

 

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
       xmlns:con="Conferencing">
       <soap:Header>
          <con:HeaderToken>
             <con:Token>Token</con:Token>
          </con:HeaderToken>
       </soap:Header>
       <soap:Body>
          <con:ProvisioningCompanyCreate>
             <con:request>
                <con:Company>
                   <con:Name>Name</con:Name>
                   <con:Address>
                      <con:Address1>Address1</con:Address1>
                      <con:Address2>Address2</con:Address2>
                      <con:City>City</con:City>
                      <con:State>State</con:State>
                      <con:Zip>Zip</con:Zip>
                      <con:Country>Country</con:Country>
                   </con:Address>
                   <con:BlastEmailAllowed>false</con:BlastEmailAllowed>
                   <con:Enterprise>Ent</con:Enterprise>
                   <con:Provider>Pro</con:Provider>
                </con:Company>
             </con:request>
          </con:ProvisioningCompanyCreate>
       </soap:Body>
    </soap:Envelope>

 

Here is the code I am using to TRY and do this:

 

require_once "SOAP/Client.php";

$wsdl_url = $url;
$WSDL = new SOAP_WSDL($wsdl_url); 
$client = $WSDL->getProxy(); 
$empToken = $responseEmp->Token;
$firstName = $_POST['billTo_firstName'];
$lastName = $_POST['billTo_lastName'];
$randNum = rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9);
$compName = $firstName." ".$lastName." (".$randNum.")";
$params = new Soap_Header("HeaderToken","object",array("Token" => $empToken));
$params2 = array(
	'Name' => $compName,
	'Address1' => $_POST['billTo_street1'],
	'Address2' => $_POST['billTo_street2'],
	'City' => $_POST['billTo_city'],
	'State' => $_POST['billTo_state'],
	'Zip' => $_POST['billTo_postalCode'],
	'Country' => $_POST['billTo_country'],
	'BlastEmailAllowed' => 'false',
	'Enterprise' => $enterprise,
	'Provider' => $provider
);

$client->addHeader($params);
$responseComp = $client->ProvisioningCompanyCreate($params2);

print_r($responseComp);

 

However, it isn't working.  I'm not sure what I am doing wrong.  I am getting the following error message from the url: Server was unable to process request. ---> 26010: Web service validation token is null.

 

And here is what I am sending:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="Conferencing">

<SOAP-ENV:Header>

<HeaderToken SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="0">
<Token>Token</Token></HeaderToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns4:ProvisioningCompanyCreate>
<ns4:request>
<ns4:Name>Test User (83501)</ns4:Name>
<ns4:Address1>123 Test Blvd.</ns4:Address1>
<ns4:Address2>#4208</ns4:Address2>
<ns4:City>City</ns4:City>

<ns4:State>State</ns4:State>
<ns4:Zip>Zip</ns4:Zip>
<ns4:Country>Country</ns4:Country>
<ns4:BlastEmailAllowed>false</ns4:BlastEmailAllowed>
<ns4:Enterprise>Ent</ns4:Enterprise>
<ns4:Provider>Pro</ns4:Provider></ns4:request></ns4:ProvisioningCompanyCreate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Can anybody help me with this at all?

Link to comment
https://forums.phpfreaks.com/topic/129815-pearsoap-header-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.