Inspect XML created by PHP SoapClient call before/without sending the request

前端 未结 3 1415
忘掉有多难
忘掉有多难 2020-12-04 11:35

The question: Is there a way to view the XML that would be created with a PHP SoapClient function call BEFORE you actually send the request?

background:

I am

3条回答
  •  渐次进展
    2020-12-04 11:57

    I found this thread while working on the same problem, and was bummed because I was using classes that already extended the SoapClient() class and didn't want to screw around with it too much. However if you add the "exceptions"=>0 tag when you initiate the class, it won't throw a Fatal Error (though it will print an exception):

    SoapClient($soapURL,array("trace" => 1,"exceptions"=>0));
    

    Doing that allowed me to run __getLastRequest() and analyze the XML I was sending.

提交回复
热议问题