我想尝试使用 curl 函数在 php 中调用soap方法,但它显示一个警告
警告:curl_setopt() [function.curl-setopt]:第 26 行 /home/bestbus/public_html/apitest.php 中的 curl 配置选项无效
<?
$xml_data ='<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:rsr="http://webservices.foxfireindia.com/RSRSAPI">
<soap:Header>
<rsr:LinkCredentials>
<!--Optional:-->
<rsr:Login>***main</rsr:Login>
<!--Optional:-->
<rsr:Password>****@3api</rsr:Password>
</rsr:LinkCredentials>
</soap:Header>
<soap:Body>
<rsr:Login>
<!--Optional:-->
<rsr:userName>***main</rsr:userName>
<!--Optional:-->
<rsr:password>****@3api</rsr:password>
</rsr:Login>
</soap:Body>
</soap:Envelope>';
$URL = "http://115.254.89.1:8090/RSRS_APITest/RSRSAPI.asmx?wsdl";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_MUTE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
print_r($output);
curl_close($ch);
?>