How can the trace mode be enabled in Ext/SOAP to retrieve the XML data with __getLastRequest()?

To enable the trace mode in Ext/SOAP to retrieve the XML data with __getLastRequest(), you need to set the trace option to true when creating the SOAP client. This will allow you to access the XML data using the __getLastRequest() method after making a SOAP request.

$options = array(
    'trace' => 1,
);

$client = new SoapClient('http://example.com/service.wsdl', $options);

// Make SOAP request
$response = $client->__soapCall('someFunction', array('param1' => 'value1'));

// Retrieve XML data
$xmlRequest = $client->__getLastRequest();
echo $xmlRequest;