I’m trying to send a SOAP request but I receive an error telling me that some parameters are invalid. Here’s the code:
$client = new SoapClient('https://live.domainbox.net/?WSDL', array('soap_version' => SOAP_1_2));
$params = array(
'AuthenticationParameters' => array(
'Reseller' => 'reseller',
'Username' => 'username',
'Password' => 'password'
),
'CommandParameters' => array(
'DomainName' => 'mydomain.com',
'LaunchPhase' => 'GA'
)
);
$result = $client->CheckDomainAvailability($params);
print_r($result);
Here’s the error message:
stdClass Object
(
[CheckDomainAvailabilityResult] => stdClass Object
(
[ResultCode] => 201
[ResultMsg] => Authentication Failed: Invalid Authentication Parameters
[TxID] => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
[AvailabilityStatus] => 3
[AvailabilityStatusDescr] => ErrorOccurred
[LaunchPhase] => GA
[DropDate] =>
[BackOrderAvailable] =>
)
)
I want to see the request sent to the server to make sure it’s well formated.
Here’s how it need to be formated:
<soap12:Envelope xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:soap12=”http://www.w3.org/2003/05/
soap-envelope”>
<soap12:Body>
<CheckDomainAvailability xmlns=”https://live.domainbox.net/”>
<AuthenticationParameters>
<Reseller>myreseller</Reseller>
<Username>myuser</Username>
<Password>mypassword</Password>
</AuthenticationParameters>
<CommandParameters>
<DomainName>checkadomain.co</DomainName>
<LaunchPhase>GA</LaunchPhase>
</CommandParameters>
</CheckDomainAvailability>
</soap12:Body>
</soap12:Envelope>
How can I print the request that has been sent to the server?
I already tried:
echo $client->__getLastRequest();
But I got nothing, even in the source code of the page.
Thanks
Add tracing option:
Then
__getLastRequest()should work.