ID:               42183
 Updated by:       [EMAIL PROTECTED]
 Reported By:      heitor dot m at gmail dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         SOAP related
 Operating System: Linux RedHat Enterprise V4
 PHP Version:      5.2.3
-Assigned To:      
+Assigned To:      dmitry


Previous Comments:
------------------------------------------------------------------------

[2007-08-02 14:57:19] heitor dot m at gmail dot com

Description:
------------
Hi,

I was tryning to implement a soap server-cliint in non-wsdl mode but i
get some strange errors. This set o tests is about the class option.
I try to use this option in non-wsdl mode. Like i don't find any
explicity explanatin about the possibility of this use, i has been maked
some tests, and i think tath i found a bug.

When i put the classmap option in the server i have the follow
response:
============================================================
(HTTP) Error Fetching http headers
============================================================

And when i put the classmap in the client i have no response. The
server offer to me download the called file, but this is a blank
archive.


I hav been reported the documentation leak here:
http://bugs.php.net/bug.php?id=42182

i already serach to related bug reports and don't find nothing.

Reproduce code:
---------------
SERVER:
<?php

class PHPObject
{
        public $prop1;
        public $prop2;
        public $propc;

        public function __construct($a, $b, $c)
        {
                $this->prop1 = $a;
                $this->prop2 = $b;
                $this->propc = $c;
        }
        
}

function send($client_builded) 
{

        $server_builded = new PHPObject("server_sttuf", 0.3, false);
        
        $arr_params['server_builded'] = $server_builded;
        $arr_params['client_builded'] = $client_builded;
        
        return $arr_params;
}

$classmap = array('Object' => 'PHPObject');

$server = new SoapServer(NULL, array('uri' => 'http://ws.sit.com',
'classmap' => $classmap));

$server->addFunction(array("send"));
$server->handle();              

?>

=========================================================
Client:
<?php

class PHPObject
{
        public $prop1;
        public $prop2;
        public $propc;

        public function __construct($a, $b, $c)
        {
                $this->prop1 = $a;
                $this->prop2 = $b;
                $this->propc = $c;
        }

}

try {

        $classmap = array('Object' => 'PHPObject');
        
        $client = new SoapClient(NULL, 
                array(
                        'uri' => 'http://ws.sit.com', 
                        'location' =>
'http://10.11.40.177/developers/heitor/ws/teste2/teste2_ser.php',
                        'trace' => 1
                        )
    );

    $obj = new PHPObject("things", 3.14, TRUE);
        $res = $client->__call('send', array(new SoapParam($obj, 'Object')));

        echo "<hr>SEND<hr><pre>";
        var_dump($res);
        echo "</pre><hr>";

        echo "<hr>RESPONSE<hr><pre>";
        echo htmlspecialchars(str_replace("><", ">\n<",
$client->__getLastResponse()));
        echo "</pre><hr>";

} catch (SoapFault $sf) {

        echo "<hr><pre>";
        print_r("(" . $sf->faultcode . ") " . $sf->faultstring);
        echo "</pre><hr>";

} catch (Exception  $e) { 

        echo "<hr><pre>";
        print_r($e);
        echo "</pre><hr>";

}

?>

Expected result:
----------------
the print of the obects

Actual result:
--------------
described errors


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42183&edit=1

Reply via email to