SOAP Server -> service() jams in PHP5/Apache2/Win32
| From: | Ville Mattila | Date: | Mon, 03 Apr 2006 21:54:30 +0000 |
| Subject: | SOAP Server -> service() jams in PHP5/Apache2/Win32 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23528@lists.php.net to get a copy of this message | ||
Hi there,
I try to create a SOAP server with PEAR's SOAP package with following
script:
<?
require_once "SOAP/Server.php";
require_once "SOAP/Disco.php";
class myService {
var $__dispatch_map = array();
function __construct() {
$this->__dispatch_map['AskQuestion'] =
array('in' => array('question'=> 'string'),
'out' => array('answer' => 'string'),
);
}
function AskQuestion($question) {
return 'yes';
}
}
// Initializing the server
$server = new SOAP_Server();
$webservice = new myService();
$server->addObjectMap($webservice,'http://schemas.xmlsoap.org/soap/envelope/');
if (isset($_SERVER['REQUEST_METHOD']) &&
$_SERVER['REQUEST_METHOD']=='POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
$disco = new SOAP_DISCO_Server($server,'myService');
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) &&
strcasecmp($_SERVER['QUERY_STRING'],'wsdl') == 0) {
// show only the WSDL/XML output if ?wsdl is set in the address bar
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
}
}
exit;
?>
Everything works theoretically works fine while until I try to consume
the webservice, i.e run $server->service(). The whole script and Apache2
server jams. No response to any query from the Apache before rebooting
the server.
Any advice?
I have PHP 5.1.2 and Apache 2.0.48 installed on Windows XP Pro - just
for development environment.
Thanks,
Ville