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:15
Avg. Score:4.4 ± 1.0
Reproduced:14 of 15 (93.3%)
Same Version:0 (0.0%)
Same OS:7 (50.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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: willem at mollie dot nl
New email:
PHP Version: OS:

 

 [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

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC