📜  如何使用curl方法在php中调用soap api - PHP代码示例

📅  最后修改于: 2022-03-11 14:54:03.787000             🧑  作者: Mango

代码示例1
 "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => 
  "
  
      
  
",
  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;
}
?>
//call soap API in php