problem with webservices using soap

Problems with the Windows version of XAMPP, questions, comments, and anything related.

problem with webservices using soap

Postby rav_nan » 21. August 2007 09:12

i wrote this code to create the webservice (server.php)

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

// Your class
class HelloServer {
var $__dispatch_map = array();

function HelloServer() {
// Define the signature of the dispatch map
$this->__dispatch_map['sayHello'] =
array('in' => array('inputString' => 'string'),
'out' => array('outputString' => 'string'),
);
}

// Required function by SOAP_Server
function __dispatch($methodname) {
if (isset($this->__dispatch_map[$methodname]))
return $this->__dispatch_map[$methodname];
return NULL;
}

// Your function
function sayHello($inputString)
{
return 'Hello '.$inputString;
}
}

// Fire up PEAR::SOAP_Server
$server = new SOAP_Server;

// Fire up your class
$helloServer = new HelloServer();

// Add your object to SOAP server (note namespace)
$server->addObjectMap($helloServer,'urn:HelloServer');

// Handle SOAP requests coming is as POST data
if (isset($_SERVER['REQUEST_METHOD']) &&
$_SERVER['REQUEST_METHOD']=='POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
// Deal with WSDL / Disco here
require_once 'SOAP/Disco.php';

// Create the Disco server
$disco = new SOAP_DISCO_Server($server,'HelloServer');
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) &&
strcasecmp($_SERVER['QUERY_STRING'],'wsdl')==0) {
echo $disco->getWSDL(); // if we're talking http://www.example.com/index.php?wsdl
} else {
echo $disco->getDISCO();
}
exit;
}
?>




but instead it gives me this error as:

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 134

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 359

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 360

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 372

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 382

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 507

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 508

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 793

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Server.php on line 806

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 201

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 522

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 627

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 628

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 743

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 882

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 1052

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 1081

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 1112

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 1159

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Base.php on line 1203

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR.php on line 563

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\PEAR.php on line 566

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 212

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 213

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 214

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 219

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 220

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 221

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 275

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 322

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 343

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 350

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Parser.php on line 415

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Value.php on line 90

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\Value.php on line 93

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 217

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 238

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 792

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1070

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1153

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1195

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1243

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1257

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1271

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1306

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1351

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1354

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1379

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1381

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1420

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1631

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1679

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1734

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\SOAP\WSDL.php on line 1753

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\HTTP\Request.php on line 341

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\HTTP\Request.php on line 659

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\HTTP\Request.php on line 672

Strict Standards: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\HTTP\Request.php on line 717

Strict Standards: Redefining already defined constructor for class Net_URL in C:\xampp\php\PEAR\Net\URL.php on line 122

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\php\PEAR\SOAP\Server.php:134) in C:\xampp\eclipse\workspace\PhpPrograms\server.php on line 49

is there any configuration to do with PEAR please do let me know
rav_nan
 
Posts: 6
Joined: 21. August 2007 08:32

Postby Wiedmann » 21. August 2007 13:32

Lower your error_reporting level.
--> PEAR is not compatible with STRICT
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby rav_nan » 22. August 2007 07:32

Wiedmann wrote:Lower your error_reporting level.
--> PEAR is not compatible with STRICT


Thank you very much that solved my issue of configuration. the code generated a wsdl. but i wrote a client code as follows:

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

// Modify the URL here - note the "?wsdl" at the end
$wsdl = new SOAP_WSDL ('http://localhost/PhpPrograms/server.php?wsdl');

$helloClient = $wsdl->getProxy();

echo ($helloClient->sayHello('Bill'));
?>


it gives me the following error

Catchable fatal error: Object of class SOAP_Fault could not be converted to string in C:\xampp\eclipse\workspace\PhpPrograms\client.php on line 9
rav_nan
 
Posts: 6
Joined: 21. August 2007 08:32

Postby Wiedmann » 23. August 2007 11:57

There was an error in the SOAP request, because $helloClient is now an error object (SOAP_Fault). And an error object can't be outputted (converted to) as string.

BTW:
I think it's better to ask such questions in the PEAR general list "http://pear.php.net/support/lists.php" or a special PEAR forum "http://pear.php.net/support/forums.php".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 36 guests