#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    12
    Rep Power
    0

    Help with SOAP and PHP


    Hey everyone,

    I hope someone can help me out. I am having trouble using a SOAP API and PHP. I am trying to connect to our SugarCRM server.

    I get the following error:
    Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in /home/content/19/10733719/html/form-action.php:23 Stack trace: #0 /home/content/19/10733719/html/form-action.php(23): SoapClient->__call('login', Array) #1 /home/content/19/10733719/html/form-action.php(23): SoapClient->login(Array, 'sugarcrm') #2 {main} thrown in /home/content/19/10733719/html/form-action.php on line 23


    This is my code:
    Code:
    <?php
    
    // set up options array
    $options = array(
    "location" => 'http://xxxxxxx/sugarcrm//soap.php',
    "uri" => '(URL address blocked: See forum rules)
    "trace" => 1
    );
     
    //user authentication array
    $user_auth = array(
    "user_name" => 'admin',
    "password" => MD5('password'),
    "version" => '.01'
    );
     
    // connect to soap server
    $client = new SoapClient(NULL, $options);
     
    // Login to SugarCRM
    $response = $client->login($user_auth,'sugarcrm');
    $session_id = $response->id;
    $user_id = $client->get_user_id($session_id);
    // look what modules sugar exposes
    $response = $client->get_available_modules($session_id);
    
    
    var_dump($response);
     
    
    ?>
    Line 23 from my error is the following line: $response = $client->login($user_auth,'sugarcrm');

    I have double checked my login credentials a hundred times, so I know thats not it.
    Any help is greatly appreciated.

    Thank you.
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    The error basically says that the URI you provided isn't a soap document
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    12
    Rep Power
    0
    Originally Posted by ManiacDan
    The error basically says that the URI you provided isn't a soap document

    Ok, so how do I find the right soap document?
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Ask whoever provided you with the soap access point in the first place. There's no "rule" for finding soap endpoints, someone tells you where it is and you put it into PHP.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2006
    Posts
    40
    Rep Power
    9
    Originally Posted by ManiacDan
    Ask whoever provided you with the soap access point in the first place. There's no "rule" for finding soap endpoints, someone tells you where it is and you put it into PHP.
    This is exactly what you should do. You should also check the api connection code of the soap provided.

IMN logo majestic logo threadwatch logo seochat tools logo