Remoting Framework

Discussion in 'General' started by dayjahone, Oct 25, 2008.

  1. dayjahone

    dayjahone Member

    I am trying to set up Remoting Framework so I can add users to a website remotely.

    Do we still need to change the ISPConfig install script so it doesn't disable xml? If so, is there a way to do it retroactively as I've already installed ISPConfig 2.2.27.

    I also installed remoting framework, added a user, checked all the little boxes under the user, and uncommented the function to add a reseller in the test.php file, and I when I browse to mydomain.com/test.php, I get
    Code:
    Script end ...
    but it doesn't actually create a reseller.

    Also, can you still use Remoting Framework to add users? I had this working a long time ago and used the following:

    Code:
    // Add User
    $params = array (         'sid'        => $session_id,
                                            'module'         => 'web',
                                            'function'         => 'user_add',
                                            'params'        => array ( web_title => 'mydomain.com',  // web_title or web_id
                                            user_username => $new_username_field,
                                            user_name => $first_name,
                                            user_email => $new_username_field,
                                            user_passwort => $new_password_field,
                                            user_speicher => 0,
                                            user_mailquota => 1000,
                                            user_admin => 0
                                            ));
    
    $user_id = $soap_client->call('service',$params);
    if($err = $soap_client->getError()) die("Error: ".$err);
    I tried it and again got "script end..." without it adding a user.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No.

    Yes.

    Which version of the remoting framework did you install?
     
  3. dayjahone

    dayjahone Member

    The latest and greatest: Remoting extension 4.2 Beta.

    I seem to remember in an older version, "add users" was an option you can give your remoting access user. I don't see that anymore.

    Any idea why I'm not getting an error, but it's not doing anything?

    Thanks.
     
  4. dayjahone

    dayjahone Member

    I just barely setup the system...installed hardy heron, ISPConfig 2.2.27, and remoting extension 4.2...
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Which message do you get if you call the remoting URL, the one that you specified in the remoting client script, directly in a browser?
     
  6. dayjahone

    dayjahone Member

  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, thats fine. But you must specify the complete URL in the test file.
     
  8. dayjahone

    dayjahone Member

    So, in the test.php file, it should say:

    Code:
    $soap_client = new soap_client($server_url.'https://server1.mydomain.com:81/remote/index.php');
    ?
     
  9. dayjahone

    dayjahone Member

    It gives me an error and says it cannot resolve the host. I looked back in the old file that worked on the old machine and it and it had the following, which is the same in the test.php file:

    Code:
    // Insert here your 42go Server
    $server_url = "https://server1.mydomain.com:81";
    
    // creating object for SoapClient
    $soap_client = new soap_client($server_url.'/remote/index.php');
    Any ideas where I'm going wrong?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    This is fine. Just make sure that https://server1.mydomain.com:81 is correct. Also you need to install the openssl extension for php on the server that runs the client as you connect with https and not http.
     
  11. dayjahone

    dayjahone Member

    I'm assuming it's correct. When I go to https://server1.mydomain.com:81, I can login.

    What is the package name for openssh extension? Is this not part of the perfect setup? (I'm running Hardy Heron).
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    This does only mean that you installed ISPCOnfig correctly and not the the php which runs the client script has openssl compiled in. Where did you run the client script?
     
  13. dayjahone

    dayjahone Member

    I'm sorry, but I don't know what you mean. This is the extent of what I have done:

    1) Setup ISPConfig according to the perfect setup.
    2) Created the website www.newdomain.com
    2) Installed remoting plugin using the update manager.
    3) added a user and a password and gave him all of the rights.
    4) Edited the test.php file by adding
    Code:
    $server_url = "https://server1.mydomain.com:81";
    and
    Code:
    $parameters = array('user' => 'user',
                        'pass' =>  'password');
    and uncommenting the function to create a reseller.
    5) I then uploaded test.php, soap.lib.php, and auto.php to ftp.newdomain.com.
     
  14. jnsc

    jnsc rotaredoM Moderator

  15. dayjahone

    dayjahone Member

    It's not a production server, so I will try that...thanks...I'm a little surprised to run into problems when I'm not doing anything out of the ordinary.
     
  16. dayjahone

    dayjahone Member

    Now, I get the following error:

    Fatal error: Class 'soap_client' not found in /var/www/web1/web/test.php on line 18

    So I did a search and replace for all every instance of soapclient and changed it to soap_client based on the first times I tried this and still no luck: http://howtoforge.com/forums/showthread.php?t=13855&highlight=uncaught SoapFault exception

    I have no idea where it is at now. How can I uninstall the plug-in and start over...and is this advisable? Did I do anything wrong in my initial setup?
     
  17. jnsc

    jnsc rotaredoM Moderator

    Sorry, this was not explained very well in the bug report, you will have to replace soapclient, or now soap_client with nusoap_client.
     
  18. dayjahone

    dayjahone Member

    Now I get the following error:

    Code:
    Error: Response not of type text/xml: text/html
     
  19. jnsc

    jnsc rotaredoM Moderator

    Ok, try to past this
    Code:
    echo '<h2>Request</h2>';
    echo '<pre>' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2>';
    echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
    
    in your test.php file
     
    Last edited: Oct 28, 2008
  20. dayjahone

    dayjahone Member

    I wasn't sure where to put it, but here is what I have now in my test file:

    Code:
    <?php
    
    /**
    * ISPConfig Soap Connector
    * Version 1.3
    * (c) Projektfarm GmbH 2005
    *
    * This script requires PHP with CURL extension
    *
    */
    
    include("soap.lib.php");
    
    // Insert here your 42go Server
    $server_url = "https://server1.mydomain.com:81";
    
    // creating object for nusoap_client
    $nusoap_client = new nusoap_client($server_url.'/remote/index.php');
    
    // Username and Password of the remoting user (not identical
    // with the user to log into the web interface!)
    
    $parameters = array('user' => 'roach',
                        'pass' =>  'two');
    
    // Login into 42go Server
    $session_id = $nusoap_client->call('login',$parameters);
    
    // Error Check
    if($err = $nusoap_client->getError()) die("Error: ".$err);
    
    /*
    // Get Reseller List
    $params = array (	'sid'       => $session_id,
                        'module'	=> 'reseller',
                        'function'	=> 'reseller_list',
                        'params'    => '');
    
    
    $reseller_list = $nusoap_client->call('service',$params);
    // Error Check
    if($err = $nusoap_client->getError()) die("Error: ".$err);
    print_r($reseller_list);
    */
    
    /*
    // Get Reseller
    $params = array (	'sid'        => $session_id,
                        'module'     => 'reseller',
                        'function'   => 'reseller_get',
                        'params'     => array ( reseller_title => "Reseller1"));
    
    
    $reseller = $nusoap_client->call('service',$params);
    // Error Check
    if($err = $nusoap_client->getError()) die("Error: ".$err);
    print_r($reseller);
    */
    
    
    // Adding a reseller
    $params = array ( 'sid'      => $session_id,
                      'module'   => 'reseller',
                      'function' => 'reseller_add',
                      'params'   => array (         reseller_title => 'Reseller1',
                                    firma => 'Reseller4',
                                    vorname => 'Jens',
                                    limit_user => '50',
                                    limit_disk => '1000',
                                    limit_web => '10',
                                    limit_domain => '10',
                                    name => 'Jensen',
                                    strasse => 'Hauptstr. 1',
                                    plz => '12345',
                                    ort => 'Hauptstadt',
                                    telefon => '0511 5469766',
                                    fax => '0511 9799655',
                                    email => 'test@hostobserver.com',
                                    internet => 'http://www.reseller4.tld',
                                    reseller_user => 'reseller4',
                                    reseller_passwort => 'huhu',
                                    anrede => 'Herr',  // Herr, Frau, Firma
                                    land => 'Deutschland',
                                    limit_httpd_include => '1',
                                    limit_dns_manager => '1',
                                    limit_domain_dns => '50',
                                    province => 'Niedersachsen',
                                    limit_shell_access => '0',
                                    limit_cgi => '1',
                                    limit_php => '1',
                                    limit_ssi => '1',
                                    limit_ftp => '1',
                                    limit_mysql => '1',
                                    limit_ssl => '1',
                                    limit_anonftp => '1',
                                    limit_standard_cgis => '1',
                                    limit_wap => '1',
                                    limit_error_pages => '1',
                                    limit_frontpage => '0',
                                    limit_mysql_anzahl_dbs => '100',
                                    limit_slave_dns => '50',
                                    client_salutatory_email_sender_email => '',
                                    client_salutatory_email_sender_name => '',
                                    client_salutatory_email_bcc => '',
                                    client_salutatory_email_subject => '',
                                    client_salutatory_email_message => '',
                                    standard_index => '',
                                    user_standard_index => ''
                                    ));
    
    echo '<h2>Request</h2>';
    echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2>';
    echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
    
    $reseller_id = $nusoap_client->call('service',$params);
    if($err = $nusoap_client->getError()) die("Error: ".$err);
    print_r($reseller_id);
    ...and...

    I now get the same error:

    Code:
    Error: Response not of type text/xml: text/html
    I put it at the very end...same error.
     
    Last edited: Oct 29, 2008

Share This Page