есть задача отправить запрос по SOAP и получить ответ.
Запрос вида:
[URL=http://parts.major-auto.ru:8066/PartsProcessing.asmx?op=GetAvailability]http://parts.major-auto.ru:8066/PartsProcessing.asmx?op=GetAvailability[/URL]
Сформировал так:
$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", "[URL=http://tempuri.org/)]http://tempuri.org/")[/URL];
$request->addParameter("request", $data);
$response = $client->send( $request );
echo "[B]SOAPRequest[/B]: <pre>".htmlspecialchars($client->getRawRequest())."</pre>";
echo "[B]SOAPResponse[/B]: <pre>".htmlspecialchars($client->getRawResponse())."</pre>";
В ответ получаю:
[B]SOAPRequest[/B]:POST /PartsProcessing.asmx HTTP/1.0
User-Agent: BITRIX SOAP Client
Host: parts.major-auto.ru
Content-Type: text/xml; charset=utf-8
SOAPAction: "[URL=http://tempuri.org/GetAvailability]http://tempuri.org/GetAvailability"[/URL];
Content-Length: 603
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="[URL=http://schemas.xmlsoap.org/soap/envelope/]http://schemas.xmlsoap.org/soap/envelope/"[/URL]; xsi="[URL=http://www.w3.org/2001/XMLSchema-instance]http://www.w3.org/2001/XMLSchema-instance"[/URL]; xsd="[URL=http://www.w3.org/2001/XMLSchema]http://www.w3.org/2001/XMLSchema"[/URL]; SOAP-ENC="[URL=http://schemas.xmlsoap.org/soap/encoding/><soap:Header></soap:Header><soap:Body><GetAvailability]http://schemas.xmlsoap.org/soap/encoding/"><soap:Header></soap:...[/URL] xmlns="[URL=http://tempuri.org/><request>]http://tempuri.org/"><request>[/URL];
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
</request></GetAvailability></soap:Body></soap:Envelope>
[B]SOAPResponse:[/B]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>
Запрос вида:
[URL=http://parts.major-auto.ru:8066/PartsProcessing.asmx?op=GetAvailability]http://parts.major-auto.ru:8066/PartsProcessing.asmx?op=GetAvailability[/URL]
Сформировал так:
$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", "[URL=http://tempuri.org/)]http://tempuri.org/")[/URL];
$request->addParameter("request", $data);
$response = $client->send( $request );
echo "[B]SOAPRequest[/B]: <pre>".htmlspecialchars($client->getRawRequest())."</pre>";
echo "[B]SOAPResponse[/B]: <pre>".htmlspecialchars($client->getRawResponse())."</pre>";
В ответ получаю:
[B]SOAPRequest[/B]:POST /PartsProcessing.asmx HTTP/1.0
User-Agent: BITRIX SOAP Client
Host: parts.major-auto.ru
Content-Type: text/xml; charset=utf-8
SOAPAction: "[URL=http://tempuri.org/GetAvailability]http://tempuri.org/GetAvailability"[/URL];
Content-Length: 603
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="[URL=http://schemas.xmlsoap.org/soap/envelope/]http://schemas.xmlsoap.org/soap/envelope/"[/URL]; xsi="[URL=http://www.w3.org/2001/XMLSchema-instance]http://www.w3.org/2001/XMLSchema-instance"[/URL]; xsd="[URL=http://www.w3.org/2001/XMLSchema]http://www.w3.org/2001/XMLSchema"[/URL]; SOAP-ENC="[URL=http://schemas.xmlsoap.org/soap/encoding/><soap:Header></soap:Header><soap:Body><GetAvailability]http://schemas.xmlsoap.org/soap/encoding/"><soap:Header></soap:...[/URL] xmlns="[URL=http://tempuri.org/><request>]http://tempuri.org/"><request>[/URL];
<Options>
<AnalogueParts>false</AnalogueParts>
<RepairParts>false</RepairParts>
</Options>
<Rows>
<Row>
<PartNo>05280002</PartNo>
<QTY>decimal</QTY>
</Row>
</Rows>
</request></GetAvailability></soap:Body></soap:Envelope>
[B]SOAPResponse:[/B]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>