SOAP code example

Example 1: SOAP

SOAP is a messaging protocol specification for exchanging structured
information in the implementation of web services in computer networks.

Its purpose is to provide extensibility, neutrality, verbosity and independence.

Example 2: SOAP

Simple Object Access Protocol

Example 3: soap

<?php 
try{
$soapclient = new SoapClient('http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx?wsdl');
$param=array('countryCode'=>'Scotland','year'=>'2018');
$response =$soapclient->GetHolidaysForYear($param);
var_dump($response);
echo '<br><br><br>';
$array = json_decode(json_encode($response), true);
print_r($array);
 echo '<br><br><br>';
	  echo '<br><br><br>';
	foreach($array as $item) {
		echo '<pre>'; var_dump($item);
	}  
}catch(Exception $e){
	echo $e->getMessage();
}	
?>Copy

Tags:

Php Example