php.net |  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: -
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:3 (60.0%)
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
Description:
------------
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="<http://tempuri.org/0>";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


--uuid:1197eb3c-92dc-4e1e-a4d7-d4513ba4bc7a+id=54
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</faultcode><faultstring xml:lang="is-IS">An error occurred when verifying security for the message.</faultstring></s:Fault></s:Body></s:Envelope>
--uuid:1197eb3c-92dc-4e1e-a4d7-d4513ba4bc7a+id=54--


(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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 16:01:43 2019 UTC