Making SOAP Calls in Laravel4

In order to make SOAP calls from laravel4 framework, you just need to enable the soap extension in your php.ini file.
And make sure that the soap client and soap server modules are enabled in your phpinfo();
Thats it ! You can make SOAP calls from your Laravel application. Below is the code snippet I used –

$soapWSDL = Config::get(‘filename.soapWSDLPath’);
$client = new soapclient($soapWSDL);

$res = new StdClass();

// Call the SOAP method
$params = array(‘user’ => $user,
‘password’ => $password,
‘requestcontent’ => $contents);

$result = $client->SendRequest($params);

$response = $result->SendRequestResult->Response;

Leave a comment