2014-03-26 120 views
1

我需要帮助来创建SOAP 1.2请求。所有我必须是这样的:如何创建SOAP 1.2请求

样品要求:

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> 

样本响应:

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> 

非常感谢。

回答

6
<?php 
    $client = new SoapClient("URL/OF/YOUR/WSDL", array('soap_version' => SOAP_1_2)); 
    $result = $client('GetProducts'); 
?> 
+0

谢谢,你救了我的一天。 –