Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How to call soap api in php using curl method

<pre>
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => 
  "<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
  <Body>
      <ListOfContinentsByCode xmlns="http://www.oorsprong.org/websamples.countryinfo"/>
  </Body>
</Envelope>",
  CURLOPT_HTTPHEADER => array("content-type: text/xml"),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
</pre>
//call soap API in php
Comment

PREVIOUS NEXT
Code Example
Php :: php 7 strict mode 
Php :: simple localhost php 
Php :: check if array value exists in another array php 
Php :: php weekdays 
Php :: find curren monday in laravel carbon 
Php :: how to use where relationship laravel 
Php :: php split array in half 
Php :: how to build jquery messages notification with php and mysq 
Php :: Class "AppHttpControllersAdminAuth" not found 
Php :: php initialize array 
Php :: 404 page in laravel 
Php :: flutter network image svg 
Php :: mkdir permission denied php 
Php :: laravel insert timestamp now 
Php :: item count in cart quantitiy woocommerce 
Php :: lluminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 - your php version (8.0.10) does not satisfy that requirement. 
Php :: php sort array of array by key 
Php :: wp redirect 
Php :: getMessage in php 
Php :: first name of string php 
Php :: laravel 4.2 migration 
Php :: image storage storepublicy in laravel 
Php :: eloquent with 
Php :: scribe laravel 
Php :: how remove empty value in array php 
Php :: applying multiple order by in codeigniter 
Php :: access json object in php 
Php :: php sort multidimensional array by value 
Php :: implode and explode in php 
Php :: convert date to timestamp in laravel builder 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =