我正在尝试使用以下代码从服务器获取响应:
<?php
$url = "http://pgtest.redserfinsa.com:2027/WebPubTransactor/TransactorWS?WSDL";
$post_string = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservices.serfinsa.sysdots.com/">
<soapenv:Header/>
<soapenv:Body>
<web:cardtransaction>
<!--Optional:-->
<security>{"comid":"comid","key":"$!@!@!@!@!@","comwrkstation":"comwrkstation"}</security>
<!--Optional:-->
<txn>MAN</txn>
<!--Optional:-->
<message>{"CLIENT":"9999994570392223"}
</message>
</web:cardtransaction>
</soapenv:Body>
</soapenv:Envelope>';
$post_data = array('xml' => $post_string);
$stream_options = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: text/xml' . "\r\n",
'content' => http_build_query($post_data)));
$context = stream_context_create($stream_options);
$response = file_get_contents($url, null, $context);
?>
但是,我仍然收到空回复,有人知道吗?
HUX布斯