<?php
$soap = curl_init("http://www.webservicex.net/geoipservice.asmx");
curl_setopt($soap, CURLOPT_POST, 1);
curl_setopt($soap, CURLOPT_RETURNTRANSFER, 1);
$request = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Body>
<ns1:GetGeoIP xmlns:ns1="http://www.webservicex.net/">
<ns1:IPAddress>192.168.0.1</ns1:IPAddress>
</ns1:GetGeoIP>
</Body>
</Envelope>
XML;
curl_setopt($soap, CURLOPT_HTTPHEADER,
array('Content-Type: text/xml; charset=utf-8',
'Content-Length: '.strlen($request)));
curl_setopt($soap, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($soap);
curl_close($soap);
<?php
$soap = curl_init("http://localhost/test.php");
curl_setopt($soap, CURLOPT_POST, 1);
curl_setopt($soap, CURLOPT_RETURNTRANSFER, 1);
$request = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<Body>
<ns1:GetGeoIP xmlns:ns1="http://www.webservicex.net/">
<ns1:IPAddress>192.168.0.1</ns1:IPAddress>
</ns1:GetGeoIP>
</Body>
</Envelope>
XML;
$data = "xml=".urlencode($request);
curl_setopt($soap, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($soap);
curl_close($soap);
<?php
file_put_contents('file', serialize($_REQUEST));
ни в какой, читай из inputа в какой переменной POST приходит XML?
file_get_contents('php://input')
Как в никакой? Содержимое xml будет в переменной $_POST['xml']ни в какой, читай из input
PHP:file_get_contents('php://input')
Фанат, это видел?Вопрос понял. Тогда наверное нужно сделать так:
PHP:$data = "xml=".urlencode($request);
а это - стыд и позор,и никак не SOAP запросФанат, это видел?