How do I see the actual XML generated by PHP SOAP Client Class?

后端 未结 7 1618
醉酒成梦
醉酒成梦 2020-12-05 01:42

Consider this example SOAP Client script:

$SOAP = new SoapClient($WDSL); // Create a SOAP Client from a WSDL

// Build an array of data to send in the reques         


        
相关标签:
7条回答
  • 2020-12-05 02:28

    If you'd like to view the request without actually making a connection, you can override SoapClient's __doRequest method to return the XML:

    class DummySoapClient extends SoapClient {
        function __construct($wsdl, $options) {
            parent::__construct($wsdl, $options);
        }
        function __doRequest($request, $location, $action, $version, $one_way = 0) {
            return $request;
        }
    }
    $SOAP = new DummySoapClient('http://example.com/?wsdl', array('trace' => true));
    echo $SOAP->GetRequestDetail($params);
    
    0 讨论(0)
提交回复
热议问题