|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73090 __getLastResponse() returns NULL if HTTP status > 200 and not XML
Submitted: 2016-09-15 14:29 UTC Modified: -
Avg. Score:4.5 ± 0.9
Reproduced:12 of 13 (92.3%)
Same Version:0 (0.0%)
Same OS:7 (58.3%)
From: willem at mollie dot nl Assigned:
Status: Open Package: SOAP related
PHP Version: 5.6.25 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-09-15 14:29 UTC] willem at mollie dot nl
We have overridden SoapClient::__doRequest() to be able to send XML messages to a Soap service (not under our control). We update the request and then use SoapClient::__doRequest() to send the request. 

The Soap Server responds with the following message: 

HTTP/1.1 500 Internal Server Error
Content-Length: 591
Content-Type: multipart/related; type="application/xop+xml";start="<>";boundary="uuid:1197eb3c-92dc-4e1e-a4d7-d4513ba4bc7a+id=54";start-info="text/xml"
Server: Microsoft-IIS/7.5
MIME-Version: 1.0
X-Powered-By: Disclosed
Date: Thu, 15 Sep 2016 14:15:39 GMT
Connection: close

Content-ID: <>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s=""><s:Body><s:Fault><faultcode xmlns:a="">a:InvalidSecurity</faultcode><faultstring xml:lang="is-IS">An error occurred when verifying security for the message.</faultstring></s:Fault></s:Body></s:Envelope>

(Retrieved from our proxy server).

In our PHP script, a SoapFault with the message "Internal Server Error" is raised. When handling the error the following is observed:

* SoapClient::__doRequest() returns NULL.
* __getLastResponseHeaders() returns the headers received from the server
* __getLastResponse() returns NULL

Of course "trace" is set to TRUE in the SoapClient constructor. It is NOT a one way message.

When we have a server that returns a text/xml response, __getLastResponse() works as expected and returns the XML representation of the SoapFault.

Expected behaviour:

SoapClient::__doRequest() returns message received from the server (instead of returning NULL), so that overriding implementations can transform or understand the multipart message. 
__getLastResponse() returns messages received from the server.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jul 04 12:03:36 2022 UTC