php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49278 SoapClient::__getLastResponseHeaders returns NULL if wsdl operation !has output
Submitted: 2009-08-17 10:07 UTC Modified: 2011-02-11 12:37 UTC
Votes:5
Avg. Score:4.2 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: jeroen at asystance dot nl Assigned:
Status: Verified Package: SOAP related
PHP Version: 5.3.3 OS: linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-08-17 10:07 UTC] jeroen at asystance dot nl
Description:
------------
For <wsdl:operation>s that do not have output, SoapClient does not return last response headers.

Reproduce code:
---------------
download http://jayvee.nl/soaptest3.tar
change URL in interface.wsdl to point to SOAPtest.php
SOAPtest.php contains both client and server code, so just run
php SOAPtest.php

Expected result:
----------------
SoapClient::getLastResponseHeaders should return string

Actual result:
--------------
SoapClient::getLastResponseHeaders returns NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-19 20:19 UTC] sjoerd@php.net
Thank you for your bug report.

Apparently, the response is not parsed at all when the method returns nothing. This gives problems with getLastResponseHeaders, as the bug reporter described. Furthermore, if the server returns a HTTP status such as 404 Not Found or 500 Internal Error, the client should does not throw a SoapFault, where it should.

See ext/soap/php_http.c:771.
 [2011-02-11 12:31 UTC] jeroen at asystance dot nl
-PHP Version: 5.3SVN-2009-08-17 (snap) +PHP Version: 5.3.3
 [2011-02-11 12:31 UTC] jeroen at asystance dot nl
Just wanted to confirm this bug is still present in 5.3.3
 [2011-02-11 12:37 UTC] jeroen at asystance dot nl
Also, if I add 'feature' => SOAP_WAIT_ONE_WAY_CALLS to the options array in the SoapClient constructor, instead of nothing, I get

PHP Fatal error:  Uncaught SoapFault exception: [Client] looks like we got no XML document
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 07:02:14 2014 UTC