PEAR Soap Client - empty content in post
| From: | Joel Vorpagel | Date: | Fri, 21 Mar 2003 20:31:29 +0000 |
| Subject: | PEAR Soap Client - empty content in post | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-498@lists.php.net to get a copy of this message | ||
I was wondering if anyone could answer some quick
dependancy questions for me. I tried the examples
Client.php and Server.php included in PEAR-SOAP 0.6.2.
I had these running fine before upgrading to php
4.3.1. To upgrade php though - I also had to upgrade
to a curl version greater than 7.9. The examples no
longer work. This is what I get when I do a wire dump:
$soapclient->wire =
OUTGOING: POST /SimpleServer.php HTTP/1.0 User-Agent:
PEAR-SOAP 0.6.2 Host: localhost Content-Type:
text/xml; charset=UTF-8 Content-Length: 0 SOAPAction:
"" INCOMING HTTP/1.1 500 Internal Server Error Date:
Wed, 19 Mar 2003 16:52:41 GMT Server: Apache/1.3.23
(Unix) (Red-Hat/Linux) mod_ssl/2.8.7 OpenSSL/0.9.6b
DAV/1.0.3 PHP/4.3.1 mod_perl/1.26 X-Powered-By:
PHP/4.3.1 Content-Length: 676 Connection: close
Content-Type: text/xml; charset=UTF-8 SOAP-ENV:Server
method '' not defined in service
It appears that the body of my POST is empty
(Content-Length:0) Any ideas? Am I using an
incompatible version of curl (currently using 7.10.3)?
Do I need to upgrade to PEAR-SOAP 0.7.1? Are there any
dependancy libraries that are required? Any
suggestions would be greatly appreciated.
(client and server source pasted at bottom for
reference)
Thanks in advance,
Joel Vorpagel
Computer Technologies Inc
-------------------------------------------------------
<?php
//simple soap client
include("SOAP/Client.php");
$soapclient = new
SOAP_Client("http://localhost/SimpleServer.php");
$options = array('namespace' =>
'urn:SOAP_Example_Server');
$ret = $soapclient->call("echoStringSimple",
array("inputString"=>"test_string"), $options);
echo "SOAP server echoed: $ret ";
echo $soapclient->wire;
?>
<?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 echoStringSimple($inputString)
{
return $inputString;
}
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')
);
}
}
$soapclass = new SOAP_Example_Server();
$server->addObjectMap($soapclass);
$server->service($HTTP_RAW_POST_DATA);
?>
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com