Reputation: 11
i used nusoap for calling a webservice like this:
<?php
require 'nusoap/lib/nusoap.php';
$client = new nusoap_client('http://webserviceSite.com/webservices/globalservices.asmx?wsdl', 'WSDL');
$error = $client->getError();
if ($error) {
die("client construction error: {$error}\n");
}
$answer = $client->call('GetCaptchaImage');
$error = $client->getError();
if ($error) {
print_r("res:".$client->response);
print("\n");
print_r("debug:".$client->getDebug());
die();
}
print_r($answer);
?>
but i got this error: `"wsdl error: HTTP ERROR: Couldn't open socket connection to server http://webserviceSite.com/webservices/globalservices.asmx?wsdl prior to connect(). This is often a problem looking up the host name. "
plz help me.i cant understand this error
Upvotes: 1
Views: 4430
Reputation: 1354
This error is exactly what it says: "Couldn't open socket connection to server". Prior SOAP communication client must be able to establish HTTP TCP connection (usually on port 80). This error means that your client is unable to make such connection. It may be caused by many factors: firewall between client and server, server don't like your client, web proxy on the way does not allow you to connect, no routing and so on.
From the box where you run your client you should be able to do:
telnet webserviceSite.com 80
and you should see something like:
Connected to webserviceSite.com.
Escape character is '^]'
Then if you type up few characters and hit enter you should get error page from remote server and connection should close. Unless you can get your client box to connect to remote http host reliably your soap call would fail.
Upvotes: 1