From:             heitor dot m at gmail dot com
Operating system: Linux RedHat Enterprise V4
PHP version:      5.2.3
PHP Bug Type:     SOAP related
Bug description:  classmap cause error in non-wsdl mode

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

Reply via email to