我有以下代码,将XML数据发送到Web服务, 我不断收到此错误消息[GENERIC ERROR]作为resopnse 我搜索得很好,无法找到错误的位置,
我不是从启用SSL的网站发送的,我已启用cURL,
<?php
include "curl.php";
$xml2 = "<CC5Request>
<Name>esttest</Name>
<Password>EST741852</Password>
<ClientId>4444</ClientId>
<Mode>P</Mode>
<OrderId>8e8d031cb20a9d274f4ae3ccd0516053</OrderId>
<Type>Auth</Type>
<Number>4242424242424242</Number>
<Expires>10/09</Expires>
<Cvv2Val>000</Cvv2Val>
<Total>4.72</Total>
<UserId>ismail</UserId>
<Currency>949</Currency>
<email>imengubeti@est.com</email>
<BillTo>
<Name>ismail</Name>
<Street1>deneme</Street1>
<City>adfs</City>
<PostalCode>06700</PostalCode>
<Country>792</Country>
<TelVoice>0_312_446_50_07</TelVoice>
</BillTo>
<ShipTo>
<Name>ismail</Name>
<Street1>deneme</Street1>
<City></City>
<PostalCode>06700</PostalCode>
<Country>792</Country>
</ShipTo>
<Extra>
</Extra>
</CC5Request>";
$URL = "https://url/cc5ApiServer";
$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, "$xml2");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
if(curl_errno($ch))
print curl_error($ch);
else
print_r($output);
curl_close($ch);
?>
答案 0 :(得分:0)
您获得的字符串可能实际上是来自服务$ URL的远程服务器的响应主体,因此curl没有问题,问题是服务器不喜欢您发送的确切内容。