SOAP Error: DTD are not supported by SOAP

Discussion in 'General' started by Skprorok, Sep 19, 2009.

  1. Skprorok

    Skprorok New Member

    When I try to make an e-mail user ( $client->mail_user_add() ) i get error:
    "SOAP Error: DTD are not supported by SOAP".

    Can you tell me what to do please?
     
  2. Edek7

    Edek7 New Member

    Hello, It`s very simple how get this to work. Here`s the example script that is included in ISPConfig tar.gz package in remoting_client\examples directory:
    Look at it:
    <?php
    ...

    ...

    ...
    HERE IS THE GOOD example of script that adds a email user. It must contain this parameters ... all of them. Of course you must personalize settings to meet your requirements.

    $params = array( 'server_id' => 1,
    'email' => '[email protected]',
    'password' => 'franek',
    'quota' => '10',
    'maildir' => '/var/vmail/dsad.dsa/franek',
    'homedir' => '/var/vmail', 'uid' => '5000',
    'gid' => '5000',
    'postfix' => 'y',
    'disableimap' => '0',
    'disablepop3' => '0');


    $client_id = 0;
    $domain_id = $client->mail_user_add($session_id,$client_id, $params);



    if($client->logout($session_id)) {
    echo 'Wylogowany.<br />';
    }


    } catch (SoapFault $e) {
    die('SOAP Blad: '.$e->getMessage());
    }

    ?>

    I hope this helps you a lot.
     
  3. Skprorok

    Skprorok New Member

    Thanks.

    But when I use this exact script, I will get error.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. Skprorok

    Skprorok New Member

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please take a look at the link I posted above, it explains on how to debug this error.
     
  7. Skprorok

    Skprorok New Member

    When I use method posted in link above I still can't repair it.

    My source code:

    ...
    $domain_id = $client->mail_user_add($session_id,$client_id, $params);
    echo "Response:\n" . $client->__getLastResponse() . "\n";


    if($client->logout($session_id)) {
    echo 'Odhlásený.<br />';
    }

    } catch (SoapFault $e) {
    die('SOAP Error: '.$e->GetMessage());
    }

    Script will output:

    Logged into remote server sucessfully. The SessionID is .................
    SOAP Error: DTD are not supported by SOAP
     
  8. Edek7

    Edek7 New Member

    Ok, i`ll check this script because I and my friend extended the SOAP functionality. It`s seems that something is wrong with data send to the SOAP. Very likely something is missing in params ... Please be patient.

    I`ll just checked this script:

    <?php

    $username = 'admin';
    $password = 'admin';

    $soap_location = 'http://xxxxxxxxxx:8080/remote/index.php';
    $soap_uri = 'http://xxxxxxxxxxxx:8080/remote/';


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


    try {
    if($session_id = $client->login($username,$password)) {
    echo 'Zalogowany. Sesja:'.$session_id.'<br />';
    }

    $params = array( 'server_id' => 1,
    'email' => '[email protected]',
    'password' => 'franek',
    'quota' => '10',
    'maildir' => '/var/vmail/dsad.dsa/franek',
    'homedir' => '/var/vmail',
    'uid' => '5000',
    'gid' => '5000',
    'postfix' => 'y',
    'disableimap' => '0',
    'disablepop3' => '0');


    $client_id = 0;
    $domain_id = $client->mail_user_add($session_id,$client_id, $params);



    if($client->logout($session_id)) {
    echo 'Wylogowany.<br />';
    }


    } catch (SoapFault $e) {
    die('SOAP Blad: '.$e->getMessage());
    }

    ?>

    It works... so I had no idea why it doesn`t work for you.
     
    Last edited: Sep 24, 2009
  9. Skprorok

    Skprorok New Member

    Thank you very much for your time. Thank to Till too. I had bad soap location (
    $soap_location = 'http://xxxxxxxxxx:8080/remote/index.php';
    $soap_uri = 'http://xxxxxxxxxxxx:8080/remote/';
    )
    You should rewrite this two lines in example file in /remote/example.php in the install package to this lines. In the example file it is written very complicated (maybe only for me).
     

Share This Page