php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33567 SoapClient works only when exceptions are turned off
Submitted: 2005-07-04 19:52 UTC Modified: 2005-07-16 22:11 UTC
From: please-no-spam at blueyonder dot co dot uk Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.1.0b2 OS: Windows XP Pro
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: please-no-spam at blueyonder dot co dot uk
New email:
PHP Version: OS:

 

 [2005-07-04 19:52 UTC] please-no-spam at blueyonder dot co dot uk
Description:
------------
When I try to create my own web service using php 5.0.3 or 5.1.0b2 using Dmitry Stogov's example at zend.com code on Windows XP Pro IIS6:

eg:
$x = SoapClient(WSDL);

I get:

SoapFault exception: [SOAP-ENV:Client] looks like we got no XML document in
c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php:13
Stack trace:
#0 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(13):
SoapClient->__call('getQuote', Array)
#1 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(13):
SoapClient->getQuote('ibm')
#2 {main}

Enabling Trace & Disabling exceptions like this:
$x = SoapClient(WSDL, array("trace"=>1, "exceptions"=>0));
and the problem goes away.

This means I can't enable exceptions with the Soap Client.


Reproduce code:
---------------
$client = new SoapClient("stockquote.wsdl";
try
{

$client->getQuote("ibm");
echo $client->__getLastResponse();
} catch (SoapFault $exception) {
    echo $exception;
}

Expected result:
----------------
98.42

Actual result:
--------------
SoapFault exception: [SOAP-ENV:Client] looks like we got no XML document in
c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php:13
Stack trace:
#0 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(13):
SoapClient->__call('getQuote', Array)
#1 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(13):
SoapClient->getQuote('ibm')
#2 {main}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-05 15:13 UTC] dmitry@php.net
I cannot reproduce this bug, but may be this is IIS6 specific problem. Could you please add "trace" option to SoapClient constructor and the following code after soap call. 

var_dump($x->__getLastResponseHeaders());
var_dump($x->__getLastResponse());


 [2005-07-05 17:44 UTC] please-no-spam at blueyonder dot co dot uk
Dump Info From:
===============

var_dump($x->__getLastResponseHeaders());
var_dump($x->__getLastResponse());

*********************************************

string(110) "HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Tue, 05 Jul 2005 15:37:50 GMT X-Powered-By: ASP.NET " string(660) " 98.42 " 

*********************************************

Exception Info:
==============

SoapFault exception: [SOAP-ENV:Client] looks like we got no XML document in c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php:24 Stack trace: #0 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(24): SoapClient->__call('getQuote', Array) #1 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(24): SoapClient->getQuote('ibm') #2 {main}


Hope this helps.
 [2005-07-11 10:20 UTC] dmitry@php.net
Seems ext/soap is right.
You server answer - string(660) " 98.42 " is not an XML.
However may be all XML was hidden. Please try to run client from command line or use var_dump(htmlspecialchars($x->__getLastResponse())).
 [2005-07-11 23:55 UTC] please-no-spam at blueyonder dot co dot uk
From Cmd Line:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'C:\Program Files\Php\stockquote2.wsdl' in C:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php:21
Stack trace:
#0 C:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(21): SoapClient->__construct('stockquote2.wsd...', Array)
#1 {main}
  thrown in C:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php on line 21

***********************************************************

From Web Page using the browser:

SoapFault exception: [SOAP-ENV:Client] looks like we got no XML document in c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php:24 Stack trace: #0 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(24): SoapClient->__call('getQuote', Array) #1 c:\Inetpub\wwwroot\Php\DummyWebService\MyWebServerClient.php(24): SoapClient->getQuote('ibm') #2 {main}

string(110) "HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Mon, 11 Jul 2005 21:44:35 GMT X-Powered-By: ASP.NET " string(660) " 98.42 " string(868) "<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Title here!</title> </head> <body> <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getQuoteResponse><Result xsi:type="xsd:float">98.42</Result></ns1:getQuoteResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> </body> </html> " 

*******************************************************

Hope this helps.
 [2005-07-12 11:32 UTC] dmitry@php.net
Hehe. Now I see.
The soap response is proper, but for some reason it enclosed into HTML. You should have just:

<?xml version="1.0"
encoding="UTF-8"?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:xmethods-delayed-quotes"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP
-ENV:Body><ns1:getQuoteResponse><Result
xsi:type="xsd:float">98.42</Result></ns1:getQuoteResponse></SOAP-ENV:Bod
y></SOAP-ENV:Envelope>

and not any HTML tags. I haven't idea who inserted these tags (your SOAP server's script or IIS).
Please, verify you soap server PHP script and IIS configuration.
 [2005-07-16 09:22 UTC] please-no-spam at blueyonder dot co dot uk
Possible an IIS Problem
 [2005-07-16 22:11 UTC] tony2001@php.net
IIS problem -> bogus.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 08 10:01:28 2025 UTC