Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th February 2013, 14:19
minddigger minddigger is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Question SOAP Error: Could not connect to host

Hi, I want to use the API of ISPConfig 3.0.4.6 and therefore I have made a test script (using example), simply to connect to the SOAP server.
It runs on a Ubuntu 12.04.2 LTS precise server.
I have to mention that I had for about 4 months ago a working script, but now, after I have upgraded the server, it no longer works.

The script is very common:

$username = 'remoteusr';
$password = 'password';


$soap_location = 'https://myserverip:8080/remote/index.php';
$soap_uri = 'https://myserverip:8080/remote/';


$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri,
'trace' => 1));

// ini_set('soap.wsdl_cache_enabled',0);
// ini_set('soap.wsdl_cache_ttl',0);

try {
//* Login to the remote server
if($session_id = $client->login(trim($username),trim($password))) {
echo 'Logged into remote server sucessfully. The SessionID is '.$session_id.' - <br>';
}

//* Logout
if($client->logout($session_id)) {
echo "Logout for session ".$session_id;
}

} catch (SoapFault $e) {
var_dump($client->__getLastRequest())."<br>";
var_dump($client->__getLastResponse())."<br>";

echo "<br>Please contact the server administator<br>";
die('SOAP Error: '.$e->getMessage());
}


The getLastRequest gives me the username and password back
The getLastResponse gives me NULL

I don't get what is wrong here, especially where it did work before!!
Reply With Quote
Sponsored Links
  #2  
Old 20th February 2013, 14:48
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,176
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

The error "SOAP Error: Could not connect to host" indicates that either $soap_location or $soap_uri are incorrect so that sopa could not reach a server under that url.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 20th February 2013, 15:18
minddigger minddigger is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes that could be possible, but... The $soap_location AND the $soap_uri are right. They are besides the /remote part the same as what I use to login to my ISPConfig. Offcourse the 'myserverip' should be replaced by the IP or URL of the real server, but I will not encourage anyone to hack my server at this moment ;-)

When I enter the whole URL in a browser, I get a blank screen as well. I think at least it should display something...
Reply With Quote
  #4  
Old 20th February 2013, 15:31
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,176
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

Quote:
When I enter the whole URL in a browser, I get a blank screen as well. I think at least it should display something...
No, it has to be blank. When you connect to a soap server with a web borwser, then nothing gets displayed.

Did you run the browser on the same server that you run the php script on, so the connection is made from same network interface and IP?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 20th February 2013, 15:35
minddigger minddigger is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I developped it on my Desktop PC and call the servers SOAP from there. It did work in the past as I did mention earlyer and I was able to add a user as well in the API, but now it does not work anymore. As far as I can see nothing has changed, besides the upgrade of the (Ubuntu) server OS.
Reply With Quote
  #6  
Old 20th February 2013, 15:46
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,176
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

maybe the php soap extension is not installed of the server anymore. You can e.g. check that with the phpinfo() function if soap is available.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 20th February 2013, 17:57
minddigger minddigger is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope, this have I already checked. SOAP is available.
Reply With Quote
  #8  
Old 22nd February 2013, 07:35
minddigger minddigger is offline
Junior Member
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

It even getting stranger: When I use the script on a different server, or from my home location, where 'myserverip' is my server IP address or my server URL like this :

$soap_location = 'https://myserverip:8080/remote/index.php';
$soap_uri = 'https://myserverip:8080/remote/';

I got a SOAP Fault.

When I run the same script on the SOAP server itself using
$soap_location = 'https://localhost:8080/remote/index.php';
$soap_uri = 'https://localhost:8080/remote/';

it works fine!!!

When I call the SOAP servers ISPConfig admin screen from a different server, using
'https://myserverip:8080' or 'https://myserverURL:8080' I got the login screen of ISPConfig, so it could not be a DNS problem.
I'm confused because I have tried it on different servers with ISPConfig and everywhere got the same result....

Last edited by minddigger; 22nd February 2013 at 07:37.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix queue problem? murunix Server Operation 7 2nd May 2011 01:55
Email problem 'Cannot set my user or group id.' (using ISPConfig 3 + OpenSuSE 11.2) urosm Installation/Configuration 5 19th June 2010 22:41
can't send/receive mail fedora 12 - ispconfig 3 ev0css Installation/Configuration 9 17th May 2010 21:44
ISPConfig 3 Send/Receive mail not working. Acidut General 6 4th April 2010 11:24
smtp is error!!! fhawk Installation/Configuration 2 7th April 2009 13:17


All times are GMT +2. The time now is 18:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.