есть задача отправить запрос по SOAP и получить ответ.
Запрос вида:
http://parts.major-auto.ru:8066/PartsProcessing.asmx?op=GetAvailability
Сформировал так:
$data = '
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
';
$client = new CSOAPClient("parts.major-auto.ru", "/PartsProcessing.asmx");
$request = new CSOAPRequest("GetAvailability", "http://tempuri.org/") ;
$request->addParameter("request", $data);
$response = $client->send( $request );
echo "SOAPRequest: <pre>".htmlspecialchars($client->getRawRequest())."</pre>";
echo "SOAPResponse: <pre>".htmlspecialchars($client->getRawResponse())."</pre>";
В ответ получаю:
SOAPRequest:POST /PartsProcessing.asmx HTTP/1.0
User-Agent: BITRIX SOAP Client
Host: parts.major-auto.ru
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/GetAvailability" ;
Content-Length: 603
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ; xsi="http://www.w3.org/2001/XMLSchema-instance" ; xsd="http://www.w3.org/2001/XMLSchema" ; SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><soap:Header></soap:... xmlns="http://tempuri.org/"><request> ;
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
</request></GetAvailability></soap:Body></soap:Envelope>
SOAPResponse:HTTP/1.1 302 Found
Date: Sun, 20 Oct 2019 11:23:12 GMT
Location: /Error/404.htm
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.5
Cache-Control: private
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Error/404.htm">here</a>.</h2>
</body></html>
Запрос вида:
Сформировал так:
$data = '
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
';
$client = new CSOAPClient("parts.major-auto.ru", "/PartsProcessing.asmx");
$request = new CSOAPRequest("GetAvailability", "
$request->addParameter("request", $data);
$response = $client->send( $request );
echo "SOAPRequest: <pre>".htmlspecialchars($client->getRawRequest())."</pre>";
echo "SOAPResponse: <pre>".htmlspecialchars($client->getRawResponse())."</pre>";
В ответ получаю:
SOAPRequest:POST /PartsProcessing.asmx HTTP/1.0
User-Agent: BITRIX SOAP Client
Host: parts.major-auto.ru
Content-Type: text/xml; charset=utf-8
SOAPAction: "
Content-Length: 603
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
</request></GetAvailability></soap:Body></soap:Envelope>
SOAPResponse:HTTP/1.1 302 Found
Date: Sun, 20 Oct 2019 11:23:12 GMT
Location: /Error/404.htm
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.5
Cache-Control: private
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Error/404.htm">here</a>.</h2>
</body></html>