Search Results
Returns the XML sent in the last SOAP request. Note: This method works only if the SoapClient object was created with the trace option set to true.
Aug 22, 2023 · I need to debug some code which uses the SoapClient class. I found methods documented like __getLastRequest(), but it only returns null.
- These functions only works if the SoapClient object was created with the trace option set to TRUE . Try: $client = new SoapClient("http://www.webse...
- Debug a SOAP request Using a SOAP extension The easiest and best * way to debug a SOAP request is indeed to create a SOAP extension that logs the r...
- I just wrap it up for action: $client = new \SoapClient("http://127.0.0.1/services/wsdl2",array('trace' => 1,)); try{$result = $client->__SoapCa...
Jan 16, 2026 · Working with SOAP web services in PHP often involves using the built-in `SoapClient` class. While powerful, debugging SOAP requests and responses can be frustrating—especially when the `__getLastRequest()` method returns `null` when you need it most. This common issue leaves developers in the dark about what’s being sent to the server or received in return, slowing down troubleshooting. In ...
Returns the XML sent in the last SOAP request. Note: This method works only if the SoapClient object was created with the trace option set to true.
This method works only if the SoapClient object was created with the trace option set to true.
SoapClient::__getLastRequest (PHP 5, PHP 7) SoapClient::__getLastRequest — Returns last SOAP request Description public SoapClient::__getLastRequest ( ) : string Returns the XML sent in the last SOAP request. Note: This method works only if the SoapClient object was created with the trace option set to true.
People also ask
How do I return the XML sent in the last SOAP request?
How to debug a SOAP request?
Is it possible to debug using a SOAP extension?
Simple usage example of `SoapClient::__getLastRequest ()`. The `SoapClient::__getLastRequest ()` function is a built-in PHP function that returns the XML string of the most recent SOAP request made using the SoapClient class.
