problem with pear and soap
| From: | Jeff Chapman | Date: | Tue, 16 Dec 2003 20:25:30 +0000 |
| Subject: | problem with pear and soap | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9600@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to get a simple webservice to work using
Pear's soap client.
Here's the code I'm using to create the client and
invoke the call method:
<?php
require_once("SOAP/Client.php");
if(!empty($terms))
{
// What we're searching for...
$query = $terms;
$s = new
SOAP_Client('http://66.28.98.121:9090/soap');
$result = $s->call(
'getQuote',
$params = array(
'symbol' => $query
),
'urn:xmethods-delayed-quotes',
'urn:xmethods-delayed-quotes#getQuote');
}
else
{
echo "No query.";
}
?>
According to the documentation in the Client.php file,
this should be a valid way to create a soap client and
make a call. However, I always get a connect error. I
also tried this with Google's webservice and
experienced the same problem.
I'm including a partial dump of the Soap client
object. The outgoing_payload (at the bottom of the
dump) doesn't look correct.
Any help would be much appreciated. Thanks.
soap_client Object
( [_endpoint] => http://66.28.98.121:9090/soap
[_portName] =>
[__endpointType] =>
[__last_request] =>
[__last_response] =>
[__options] => Array (
[trace] => 0
[input] => parse
[result] => parse
[parameters] =>
[soapaction] => urn:xmethods-delayed-quotes#getQuote
[namespace] => urn:xmethods-delayed-quotes
[style] => rpc )
[_encoding] => UTF-8
[headersIn] =>
[__proxy_params] => Array ( )
[_soap_transport] => soap_transport_http Object (
[_debug_flag] =>
[_debug_data] =>
[_encodings] => Array (
[0] => ISO-8859-1
[1] => US-ASCII
[2] => UTF-8 )
[_myfaultcode] => HTTP
[fault] => soap_fault Object (
[error_message_prefix] =>
[error_prepend] =>
[error_append] =>
[mode] => 1
[level] => 1024
[code] => HTTP
[message] => Connect Error to 66.28.98.121:9090
[debuginfo] =>
[userinfo] =>
[callback] => )
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => SOAP_Fault
[headers] => Array (
[User-Agent] => PEAR-SOAP 0.7.5-devel
[Host] => 66.28.98.121
[Content-Type] => text/xml; charset=UTF-8
[Content-Length] => 533
[SOAPAction] =>
"urn:xmethods-delayed-quotes#getQuote" )
[timeout] => 4
[urlparts] => Array (
[scheme] => http
[host] => 66.28.98.121
[port] => 9090
[path] => /soap )
[url] => http://66.28.98.121:9090/soap
[incoming_payload] =>
[_userAgent] => PEAR-SOAP 0.7.5-devel
[encoding] => UTF-8
[result_encoding] => UTF-8
[result_headers] => Array ( )
[result_cookies] => Array ( )
[cookies] => Array ( )
[outgoing_payload] => POST /soap HTTP/1.0 User-Agent:
PEAR-SOAP 0.7.5-devel Host: 66.28.98.121 Content-Type:
text/xml; charset=UTF-8 Content-Length: 533
SOAPAction: "urn:xmethods-delayed-quotes#getQuote"
ibm
[errno] => 111
[errmsg] => Connection refused )
=====
Jeff Chapman
Software Engineer
Check out SDValidator--a free validation and text editing tool at http://sdvalidator.sourceforge.net
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/