In my wsdl file I have a user authentication block:
You're passing your request data inside options for SoapClient
instead of as parameters to the soap call.
The code should look like this (assuming the soap call is Authenticate
):
$client = new SoapClient("http://api.example.com/v2/example?wsdl");
$response = $client->Authenticate(Array(
'iId' => 123456,
'sPassword' => 'fhfhfhfhfhfhfh46464dtdts64iyiyi',
'sType' => 'ghfh57477gghdkskdk68585jghhddhdghds'));
));
And, in any event, you should use try..catch
to prevent exceptions from crashing your code.
try
{
// code here
}
catch(Exception $e)
{
// error handling goes here
die("Error: ". $e->getMessage()."\n");
}