Results 1 to 8 of 8

Thread: SOAP Communication

  1. #1
    log_cigo's Avatar
    log_cigo is offline Member
    Join Date
    Oct 2009
    Posts
    14

    Default SOAP Communication

    Hi all !

    I'm trying to let a website send form data to my sugarCRM 5.2k and insert cases.

    Using nusoap, I've got a session ID. Case's insertion is perfect, but I need a Contact Id before.

    Here is my problem :

    I'm requesting an Id on Contacts table by giving a foreign key on Contacts_cstm table thanks to get_entry_list() function. But the only return I received are false, or "Login attempt failed please check the username and password".

    However, by calling the get_user_id() function, I receive the Id of the account which I'm connected to Sugar with...

    Here is my call :

    PHP Code:
    //-- Configuration
    $soap_url 'http://www.*****.com/soap.php?wsdl';
    $soap_login 'admin';
    $soap_pass md5('***');

    //-- Connexion
    $soapsugar = new soapclient($soap_url,true);

    //-- Connexion parameters
    $user_auth = array(
        
    'user_auth' => array(
        
    'user_name' => $soap_login,
        
    'password' => $soap_pass,
        
    'version' => '0.1'
        
    ),
        
    'application_name' => 'soapcasadd');

    //-- Identification
    $result_array $soapsugar->call('login',$user_auth);

    //-- Requesting session Id
    $session_id $result_array['id'];

    //-- Parameters I want to receive
    $param_entry_list=array(
        
    'session_id'=>$session_id,
        
    'module_name'=>'Contacts',
        
    'query'=>" contacts_cstm.champ_perso_c = '651' ",
        
    'order_by'=>' contacts.id DESC',
        
    'offset'=>0,
        
    'select_fields'=>array('id'),
        
    'max_results'=>0,
        
    'deleted'=>0);

    //-- Requesting records
    $result $soapsugar->call('get_entry_list',$param_entry_list); 
    My website is on a PHP4 server, and I'm using SugarCE 5.2k.

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: SOAP Communication

    I´m not sure if this is the reason, but SugarCRM 5.2 does not suppport php 4.
    Take a look at this site to clarify.

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    log_cigo's Avatar
    log_cigo is offline Member
    Join Date
    Oct 2009
    Posts
    14

    Default Re: SOAP Communication

    Thanks but I think that the problem is elsewhere...

    My website is on a PHP4 server, and Sugar is on a PHP5 one.

    Regards

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: SOAP Communication

    The way looks good, but why do you only want to have 0 ids back ?

    >>>>>>>>>>>>>>>>>>>>>>
    'max_results'=>0,
    >>>>>>>>>>>>>>>>>>>


    What about 1, or 2, or even more than 2 ?

    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  5. #5
    log_cigo's Avatar
    log_cigo is offline Member
    Join Date
    Oct 2009
    Posts
    14

    Default Re: SOAP Communication

    Here "0" mean "All records", no ?
    I've tried with an other number for the max result field, but I've got the same return...

    My call is based on this example. Even by making a copy and paste of the code, the return is false.

  6. #6
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: SOAP Communication

    Yes 0 means all - do you really want sugar to prepare an array with all your matching contacts - needing 3Gbyte RAM perhaps?

    I wrote a little test.php which worked in my environment:

    PHP Code:
    <?php
    if(!defined('sugarEntry'))define('sugarEntry'true);
    //-- Configuration 
    $soap_url 'https://myserver/sugar/soap.php?wsdl'
    $soap_login 'myuser'
    $soap_pass md5('mypasswd'); 
    //-- Connexion 
    require_once('../include/nusoap/nusoap.php');  //must also have the nusoap code on the ClientSide.
    $soapsugar = new nusoapclient($soap_url,true); 
    //-- Connexion parameters 
    $user_auth = array( 
        
    'user_auth' => array( 
        
    'user_name' => $soap_login
        
    'password' => $soap_pass
        
    'version' => '0.1' 
        
    ), 
        
    'application_name' => 'soapcasadd'); 
    //-- Identification 
    $result_array $soapsugar->call('login',$user_auth); 

    echo(
    print_r($result_array,true));
    //-- Requesting session Id 
    $session_id $result_array['id']; 
    //-- Parameters I want to receive 
    $param_entry_list=array( 
        
    'session'=>$session_id,     // not session_id !!!
        
    'module_name'=>'Contacts'
        
    'query'=>" contacts_cstm.champ_perso_c = '651' "
        
    'order_by'=>' contacts.id DESC'
        
    'offset'=>0
        
    'select_fields'=>array('id'), 
        
    'max_results'=>1
        
    'deleted'=>0); 
    //-- Requesting records 
    $result $soapsugar->call('get_entry_list',$param_entry_list);  
    echo(
    print_r($result,true));
    ?>
    I changed nusoap and the name of the session_id.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  7. #7
    log_cigo's Avatar
    log_cigo is offline Member
    Join Date
    Oct 2009
    Posts
    14

    Default Re: SOAP Communication

    Well... it seems to work with an other module than Contacts

    I've tried with Cases :
    PHP Code:
    $param_entry_list=array(
            
    'session'=>$session_id,
            
    'module_name'=>'Cases',
            
    'query'=>" cases.id != '14' ",
            
    'order_by'=>' cases.id DESC',
            
    'offset'=>0,
            
    'select_fields'=>array('id'),
            
    'max_results'=>10,
            
    'deleted'=>0); 
    I receive my 10 records on my entry_list array.

    But when I try :
    PHP Code:
    $param_entry_list=array(
            
    'session'=>$session_id,
            
    'module_name'=>'Contacts',
            
    'query'=>" contacts.id != '14' ",
            
    'order_by'=>' contacts.id DESC',
            
    'offset'=>0,
            
    'select_fields'=>array('id'),
            
    'max_results'=>10,
            
    'deleted'=>0); 
    My return is false.

    What's wrong ?

  8. #8
    log_cigo's Avatar
    log_cigo is offline Member
    Join Date
    Oct 2009
    Posts
    14

    Default Re: SOAP Communication

    Ok problem resolved...

    In fact, there was a problem in a language traduction of Contact's module because of older customizations. An unencoded character...

    Soap call works perfectly. Thanks all !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Communication par SOAP
    By log_cigo in forum Français
    Replies: 1
    Last Post: 2010-03-18, 08:32 AM
  2. communication failure
    By admetus2 in forum Help
    Replies: 1
    Last Post: 2008-08-01, 12:02 PM
  3. SQL data communication
    By KGP in forum General Discussion
    Replies: 3
    Last Post: 2008-06-19, 09:40 PM
  4. Communication between sugar servers
    By Hawat in forum Developer Help
    Replies: 6
    Last Post: 2008-06-11, 11:53 PM
  5. Replies: 1
    Last Post: 2006-02-03, 11:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •