当前位置:网站首页>How do I dump SoapClient requests for debugging- How to dump SoapClient request for debug?

How do I dump SoapClient requests for debugging- How to dump SoapClient request for debug?

2022-07-07 02:19:00 javail

problem :

I need to debug some code which uses soap client. I need to debug some usage soap Client code .I found getLast* methods in php.net, but when I try to get last request for debug it returns NULL I am here php.net Found in the getLast* Method , But when I try to get the last debug request , It returns NULL

<?php    $client = new SoapClient("http://www.webservicex.net/ConverPower.asmx?WSDL");        $response = $client->ChangePowerUnit(array(        "PowerValue" => 100,        "fromPowerUnit" => "horsepower",        "toPowerUnit" => "megawatts"    ));            echo "====== REQUEST HEADERS =====" . PHP_EOL;    var_dump($client->__getLastRequestHeaders());    echo "========= REQUEST ==========" . PHP_EOL;    var_dump($client->__getLastRequest());    echo "========= RESPONSE =========" . PHP_EOL;    var_dump($response);?>

The result of code execution: Code execution result :

$php soap_test.php ====== REQUEST HEADERS =====NULL========= REQUEST ==========NULL========= RESPONSE =========object(stdClass)#2 (1) {  ["ChangePowerUnitResult"]=>  float(0.0746)}

How to get the content of body and headers of the last SoapClient request? How to get the last one SoapClient The content of the body and title of the request ?


Solution :

Reference resources : https://stackoom.com/en/question/wru0
原网站

版权声明
本文为[javail]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130901040064.html