How to create SOAP 1.2 request

前端 未结 2 1111
耶瑟儿~
耶瑟儿~ 2020-12-21 06:33

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.syste         


        
相关标签:
2条回答
  • 2020-12-21 06:41

    I hope this example would help you to get your issue solved. All the best!

    // SOAP 1.2 client
    $options = array('soap_version'=>SOAP_1_2, 'exceptions'=>true, 'trace'=>1);
    
    $client = new SoapClient('https://www.example.com/example.svc/SSL?wsdl', $options);
    
    $actionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing','Action','http://tempuri.org/xxxx/GetResult');
    
    $toActionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing','To','https://www.example.com/example.svc/SSL?wsdl');
    
    $headerbody = array('Action' => $actionHeader,'To' => $toActionHeader);
               
    $client->__setSoapHeaders($headerbody);
    
    $client->__setLocation('https://www.example.com/example.svc/SSL');
    
    $params = array( "param1"=>"abc", "param2"=>"ab123",c"param3"=>"ab1111" );  
    
    $client->__soapCall("GetResult", array($params));
    
    0 讨论(0)
  • 2020-12-21 06:49
    <?php
        $client = new SoapClient("URL/OF/YOUR/WSDL", array('soap_version' => SOAP_1_2));
        $result = $client('GetProducts');
    ?>
    
    0 讨论(0)
提交回复
热议问题