HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   SOAP problem with ISPConfig API (http://www.howtoforge.com/forums/showthread.php?t=55641)

xaver 5th January 2012 06:03

SOAP problem with ISPConfig API
 
Hello,

i use the API very often and normal no problem. I tested it with example code.

PHP Code:

$soap_location 'https://XXXX:8080/remote/index.php';
$soap_uri 'https://XXXX:8080/remote/';
require_once 
'iclasses/class.ispconfig.php';
$isp = new ispconfig($soap_location,$soap_uri,'XXXX','XXXX');
$isp->addClient(1,'test@test.de','test'.time(),'test'.time(),'test'.time(),3); 

But i Get an error.
Code:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="/remote/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:loginResponse><return xsi:type="xsd:string">512bc6311124f52c0b523c716de37bdf</return></ns1:loginResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP Error: looks like we got no XML document

I tried the example code, too.


Normal example code:
PHP Code:

$client = new SoapClient(null, array('location' =>  'https://XXXX:8080/remote/index.php',
                                     
'uri'      => 'https://XXXX:8080/remote/',
                                     
'trace' => 1,
                                     
'exceptions' => 1));


try {
    if(
$session_id $client->login('XXXX','XXXX')) {
        echo 
'Logged successfull. Session ID:'.$session_id.'<br />';
    }
    } catch (
SoapFault $e) {
    echo 
$client->__getLastResponse();
    die(
'SOAP Error: '.$e->getMessage());


Output:
Code:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="/remote/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:loginResponse><return xsi:type="xsd:string">512bc6311124f52c0b523c716de37bdf</return></ns1:loginResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP Error: looks like we got no XML document

regards
xaver

till 5th January 2012 09:19

Which ISPConfig version do you use and do you get any errors in the apache error.log?

xaver 5th January 2012 09:35

SVN Version, i used this forum because i think its not fault from ISPconfig.
No error in error.log
Frist line before <?xml version="1.0" encoding="UTF-8"?> is empty.

till 5th January 2012 09:54

I havent tested the remote API in SVN trunk for some time, so there might be a bug.
It looks as if the soap header is send and the script stops then, maybe there is a php error where the error message is surpressed by php.

Try to edit the file /usr/local/ispconfig/interface/web/remote/index.php and add this:

ini_set('error_reporting', E_ALL & ~E_NOTICE);

right after the inclide of the app.inc.php file

xaver 5th January 2012 12:27

I dont suppress any error. Quite the contrary i have notice errors in ispconfig skin.
But i put the ini_set in it and no change and nothing in error_log


All times are GMT +2. The time now is 07:05.

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