어떻게하면 이런 모양으로 PHP 비누 요청을 만들 수 있습니까? php curl으로 응답을 얻을 수 없습니다. 그러나 피들러 (Fiddler) 웹 디버거는 코드와 함께 잘 작동합니다. 여기 PHP에서 CURL이 작동하지 않는 비누 클라이언트 요청
원시 요청입니다 :POST http://195.230.180.189:8280/services/TopupService?wsdl HTTP/0.9 호스트 : 195.230.180.189:8280 콘텐츠 길이 : 691 PHP는 컬 요청에
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:top="http://www.inew-cs.com/mvno/integration/TopupService/">
<soapenv:Header/>
<soapenv:Body>
<top:TopupRequest>
<amount>1</amount>
<amountUnitRelation>1</amountUnitRelation>
<subscriber>
<msisdn>8801701340002</msisdn>
</subscriber>
<source>
<distributorId>PayWell</distributorId>
</source>
<referenceId>12345</referenceId>
<transactionId>09876543</transactionId>
</top:TopupRequest>
</soapenv:Body>
</soapenv:Envelope>
:
$url="http://195.230.180.189:8280/services/TopupService?wsdl";
$xml='<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:top="http://www.inew-cs.com/mvno/integration/TopupService/">
<soapenv:Header/>
<soapenv:Body>
<top:TopupRequest>
<amount>1</amount>
<amountUnitRelation>1</amountUnitRelation>
<subscriber>
<msisdn>8801701340002</msisdn>
</subscriber>
<source>
<distributorId>100</distributorId>
</source>
<referenceId>12345</referenceId>
<transactionId>09876543</transactionId>
</top:TopupRequest>
</soapenv:Body>
</soapenv:Envelope>';
$headers = array(
"Content-type: text/xml",
"Content-length: " . strlen($xml),
"Connection: close"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
echo $result = curl_exec($ch);
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
//echo 'Operation completed without any errors';
}
// Close handle
curl_close($ch);
http://php.net/manual/en/class.soapclient.php –