Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create SOAP 1.2 request

I need help with creating SOAP 1.2 request. All i have is this:

SAMPLE REQUEST:

POST /WS/PriceList.asmx HTTP/1.1
Host: gateway.systemb2b.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetProducts xmlns="http://gateway.systemb2b.com/schemas/Product" />
  </soap12:Body>
</soap12:Envelope>

SAMPLE RESPONSE:

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetProductsResponse xmlns="http://gateway.systemb2b.com/schemas/Product">
      <GetProductsResult>xml</GetProductsResult>
    </GetProductsResponse>
  </soap12:Body>
</soap12:Envelope>

Thanks a lot.

like image 329
Martin819 Avatar asked Dec 25 '22 11:12

Martin819


1 Answers

<?php
    $client = new SoapClient("URL/OF/YOUR/WSDL", array('soap_version' => SOAP_1_2));
    $result = $client('GetProducts');
?>
like image 111
Jef Avatar answered Dec 28 '22 13:12

Jef