From:             gijs at d1 dot nl
Operating system: Debian 3.1
PHP version:      5.1.2
PHP Bug Type:     SOAP related
Bug description:  SoapClient Error Fetching http headers

Description:
------------
I'm pretty experienced with PHP but this really bites me. I've created a
SoapServer with PHP5's builtin SOAP extension. Unfortunatley I cannot seem
to talk with it using PHP's SoapClient. I keep getting a "Error Fetching
http headers" error (indicating the WebService does not respond).

On my development environment (laptop running PHP 5.1.2 on windows/ apache
2.0) I have no problems when running and connecting with the webservice
(locally).

But when I put the WebService online (on a webserver) it fails.

However, only when I use PHP (SoapClient). When I'm connecting to the
remote WebService using ASP.NET it does work!
(http://www.soapclient.com/soapclient?template=%2Fclientform.html&fn=soapform&SoapTemplate=%2FSoapResult.html&SoapWSDL=http://www.zoekned.nl/test/test.wsdl)

I've also tried to connect with a PHP SoapClient running on my laptop to
the remote SoapServer running on the webserver (also error).

During the test sessions I've turned on logging to see if the Remote
WebService receives a hit . The log file is blank when I use the PHP
SoapClient (explaining the error fetching HTTP Headers).

It must be something with the SoapClient since ASP.NET can connect with
it.....

-- SERVER ----
Debian 3.1 Apache 1.3 PHP 5.1.2

---- PHP Build options -----
./configure \
        --with-apxs \
        --with-curl \
        --with-curl-dir=/usr/local/lib \
        --with-java \
        --with-gd \
        --with-gd-dir=/usr/local \
        --enable-gd-native-ttf \
        --with-ttf \
        --with-freetype-dir=/usr/local/lib \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-kerberos \
        --with-mcrypt \
        --with-mhash \
        --with-mysql=/usr/local/mysql \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/libxml \
        --with-xml2-config=/usr/local/bin/xml2-config \
        --with-xml \
        --with-zlib \
        --with-zlib-dir=/usr/local/lib \
        --with-zip \
        --with-openssl \
        --enable-bcmath \
        --enable-calendar \
        --enable-ftp \
        --enable-magic-quotes \
        --enable-sockets \
        --enable-track-vars \
        --enable-mbstring \
        --enable-memory-limit \
        --enable-soap \
        --with-tidy \
        --with-xsl \
        --with-iconv \
        --with-mime-magic  


Reproduce code:
---------------
These are the locations of the files and the source code:

http://www.zoekned.nl/test/client.php (SoapClient)

CODE
<?
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://www.zoekned.nl/test/test.wsdl";);
print_r($client->searchCompanies("iets"));
?>

server.php -> http://www.zoekned.nl/test/server.php (WebService)

CODE
<?
ini_set("soap.wsdl_cache_enabled", "0");

/***
* @param string $what
* @return string 
*/
function searchCompanies($what){
    $result = "Results!!!";
    return $result;
}

$server = new SoapServer("test.wsdl");
$server->addFunction("searchCompanies");
$server->handle();
exit();
?>

The WSDL file is found here: http://www.zoekned.nl/test/test.wsdl


Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";><SOAP-ENV:Body><searchCompaniesReturn>Results!!!</searchCompaniesReturn></SOAP-ENV:Body></SOAP-ENV:Envelope>


Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http
headers in /home/zoekned/domains/zoekned.nl/public_html/test/client.php:4
Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml
version="...', 'http://www.zoek...', 'urn:ServiceActi...', 1) #1 [internal
function]: SoapClient->__call('searchCompanies', Array) #2
/home/zoekned/domains/zoekned.nl/public_html/test/client.php(4):
SoapClient->searchCompanies('iets') #3 {main} thrown in
/home/zoekned/domains/zoekned.nl/public_html/test/client.php on line 4


-- 
Edit bug report at http://bugs.php.net/?id=37054&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37054&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=37054&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37054&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37054&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37054&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37054&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37054&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37054&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37054&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37054&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37054&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37054&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37054&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37054&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37054&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37054&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37054&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37054&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37054&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37054&r=mysqlcfg

Reply via email to