php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42183 classmap cause error in non-wsdl mode
Submitted: 2007-08-02 14:57 UTC Modified: 2007-08-22 14:18 UTC
From: heitor dot m at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.3 OS: Linux RedHat Enterprise V4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: heitor dot m at gmail dot com
New email:
PHP Version: OS:

 

 [2007-08-02 14:57 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-22 14:18 UTC] dmitry@php.net
The crash is fixed in CVS HEAD and PHP_5_2, however classmap doesn't work without WSDL anyway.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC