RE: [SOAP] soap problems revisited

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Actually, no only for the server.  The following server script will halt
without any output or php error.  The client receives no response data,
when the expected error would be something like:

Fatal error: Cannot instantiate non-existent class:  b in
.../public_html/server.php on line 12

Try:

****** [server.php]

<?php
require_once 'SOAP/Server.php';

error_reporting(E_ALL);

class A
{
    function methodA(){ return 0; }
}

class SOAP_Example_Server {
    function echoString($inputString)
    {
        // Script will die without error here
        $a = new B;

//        // Calling a non-existant method on a valid object also 
//        // causes the script to die without an error
//        $a = new A;
//        $a->methodA();

        return $inputString;
    }
}

$server =& new SOAP_Server;
$soapclass =& new SOAP_Example_Server();
$server->addObjectMap($soapclass,'urn:SOAP_Example_Server');

$server->service($HTTP_RAW_POST_DATA);
?>

****** [client.php]

<?php
include("SOAP/Client.php");

$soapclient =& new SOAP_Client("http://localhost/server.php";);

// this namespace is the same as declared in server.php $options =
array('namespace' => 'urn:SOAP_Example_Server',
                 'trace' => 1);


$ret = $soapclient->call("echoString",
                        $params = array("inputString"=>
                                        "this is a test"),
                        $options);

if (PEAR::isError($ret))
{
    echo "Failed: " . $ret->getMessage();
    echo "\n" . $soapclient->__get_wire();
}
else
{
    echo $ret;
}
?>


> -----Original Message-----
> From: Arnaud Limbourg [mailto:arnaud.limbourg@club-internet.fr]
> Sent: Thursday, 28 August 2003 3:26 PM
> To: soap@lists.php.net
> Subject: Re: [SOAP] soap problems revisited
> 
> 
> You mean,
> 
> $client = new SOAP_Client;
> 
> require_once 'SOAP/CLient.php';
> 
> ?
> 
> php soap_cli.php
>  
> Fatal error: Cannot instantiate non-existent class:
> soap_client in soap_cli.php on line 3
> 
> With the code above. Please check your php.ini display_errors
> setting and/or error_reporting (php.ini too)
> 
> Arnaud.
> 

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux