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

后端 未结 7 1654
醉酒成梦
醉酒成梦 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:03

    Extending Quinn's answer, you can also just log the request before you perform the request.

    class SoapClientDebug extends SoapClient
    {
    
    public function __doRequest($request, $location, $action, $version, $one_way = 0)
    {
        error_log("REQUEST:\n" .$request . "\n");
        error_log("LOCATION:\n" .$location . "\n");
        error_log("ACTION:\n" .$action . "\n");
        error_log("VERSION:\n" .$version . "\n");
        error_log("ONE WAY:\n" .$one_way . "\n");
    
        return parent::__doRequest($request, $location, $action, $version, $one_way);
    }
    }
    

提交回复
热议问题