Server method '' not defined in service
| From: | Joel Vorpagel | Date: | Mon, 17 Mar 2003 18:18:16 +0000 |
| Subject: | Server method '' not defined in service | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-14369@lists.php.net to get a copy of this message | ||
Can anyone tell me what is wrong with the source
below?
I tested this sample code previously, but now it
doesn't work since I upgraded from PHP 4.1.2 to PHP
4.3.1. My SimpleClient is able to call
SimpleServer.php, but for some reason the functions
that I try to call on the server are not recognized
and the result I am expecting is not returned. When I
run the line { print_r($soapclient->xml); } inside
SimpleClient.phpI get the result: SOAP-ENV:Server
method '' not defined in service.
I'm on Apache 1.3.23 with RedHat on PHP 4.3.1 and
PEAR_SOAP 0.6.2 .If anyone can point me in the right
direction I would greatly appreciate it!
Joel
SimpleClient.php
<?php
//simple soap client
include("SOAP/Client.php");
//echo "Simple Soap Client|";
//calling simpleserver.php
$soapclient = new
SOAP_Client("http://localhost/SimpleServer.php");
$namespace = 'urn:SOAP_Example_Server';
$ret = $soapclient->call("echoStringSimple",
array("inputString"=>"this is a test string"),
$namespace);
print_r $ret;
print_r($soapclient->xml);
print_r($soapclient->wire);
?>
SimpleServer.php
<?php
//simple soap server
require_once 'SOAP/Server.php';
$server = new SOAP_Server;
class SOAP_Example_Server {
var $method_namespace = 'urn:SOAP_Example_Server';
var $dispatch_map = array();
function SOAP_Example_Server() {
// the one function here has multiple out
parameters
$this->dispatch_map['echoStructAsSimpleTypes'] =
array('in' => array('inputStruct' => 'SOAPStruct'),
'out' => array('outputString' => 'string',
'outputInteger' => 'int', 'outputFloat' => 'float')
);
}
// a simple echoString function
function echoStringSimple($inputString)
{
return $inputString;
}
$soapclass = new SOAP_Example_Server();
$server->addObjectMap($soapclass);
$server->service($HTTP_RAW_POST_DATA);
?>
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com