Bug #73090 [NEW]: __getLastResponse() returns NULL if HTTP status > 200 and not XML
| From: | willem at mollie dot nl | Date: | Thu, 15 Sep 2016 14:29:41 +0000 |
| Subject: | Bug #73090 [NEW]: __getLastResponse() returns NULL if HTTP status > 200 and not XML | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-204067@lists.php.net to get a copy of this message | ||
From: willem at mollie dot nl
Operating system: any
PHP version: 5.6.25
Package: SOAP related
Bug Type: Bug
Bug description:__getLastResponse() returns NULL if HTTP status > 200 and not XML
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=73090&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73090&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73090&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73090&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73090&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73090&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73090&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73090&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73090&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73090&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73090&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73090&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73090&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73090&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73090&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73090&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73090&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73090&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73090&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73090&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73090&r=mysqlcfg