Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Debugging SOAP Issue

  1. #1
    math0ne is offline Junior Member
    Join Date
    Jul 2007
    Posts
    2

    Default Debugging SOAP Issue

    Hey Guys,

    Can anyone give me some pointers on how i should go about debugging a problem I'm having with the SOAP server. Essentially Everything works fine but after i add a set of custom field to the leads and contacts module the SOAP server stops responding to certain requests. Specifically get_module_fields on those modules.

    The server does not throw any errors it just stops responding to certain requests. Is there some built in debugging functions i could be using to figure out why its bailing on my fields? There's nothing in my php error log or the sugar error log.

    Any help at all would be greatly appreciated. I attached my diagnostic info.
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2007
    Location
    San Jose, CA
    Posts
    1,169

    Default Re: Debugging SOAP Issue

    You're timing is perfect... this project was just posted earlier this month to SugarForge. It's called "Soap Debugging Tools" and can be found here.
    Susie Williams

  3. #3
    math0ne is offline Junior Member
    Join Date
    Jul 2007
    Posts
    2

    Default Re: Debugging SOAP Issue

    Thanks for the link. I think i've got enough debugging info to solve the problem i just have to decipher it all now. I used this code:

    Code:
    <pre>
    
    <?php
    
    if(!defined('sugarEntry'))define('sugarEntry', true);
    require_once('/var/www/html/xxx/nusoap.php');
    $config['sugar_server'] = "http://xxx.com/crm/soap.php?wsdl"; 
    
    $config['login'] = array( 
        'user_name' => 'xxx', 
        'password' => md5('xxx') 
    ); 
    //$config['msg']="kldsfls"; 
    //echo $config['msg']; 
    $config['application_name'] = 'harysh_test'; 
    
    
    $sugarClient = new soapclient($config['sugar_server'], TRUE); 
    $err = $sugarClient->getError(); 
    if ($err) { 
        var_dump($err); 
        die(); 
    } 
    
    $sugarClientProxy = $sugarClient->getProxy(); 
    if (!$sugarClientProxy) { 
        var_dump($err); 
        die(); 
    } 
    
    $result = $sugarClientProxy->login($config['login'], $config['application_name']); 
    $session_id = $result['id']; 
    
    
    //Code for invoking the search method 
    $module_name='Contacts'; 
    $query='contacts.last_name like "%" '; 
    $order_by='contacts.last_name'; 
    $offset=0; 
    $select_fields=''; 
    $max_results=5; 
    $deleted=0; 
    $search_list=$sugarClientProxy->get_module_fields($session_id,"Leads"); 
    
    echo "Search result is <pre>"; 
    print_r($search_list); 
    echo "</pre>"; 
    
    
    echo '<h2>Request</h2><pre>' . htmlspecialchars($sugarClientProxy->request, ENT_QUOTES) . '</pre>'; 
    echo '<h2>Response</h2><pre>' . htmlspecialchars($sugarClientProxy->response, ENT_QUOTES) . '</pre>'; 
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($sugarClientProxy->debug_str, ENT_QUOTES) . '</pre>'; 
    
    
    
    
    $sugarClientProxy->logout($session_id);  
    
    ?>
    and got this responce:

    http://phpfi.com/257998

    with this in the debug log:

    http://phpfi.com/257999

    I'm thinking this line is a clue, but i'm not sure..

    2007-08-22 14:43:40.447218 soap_proxy_1855768581: Error: HTTP Error: socket read of headers timed out

    Any ideas?

  4. #4
    dbischoff is offline Member
    Join Date
    Sep 2007
    Posts
    6

    Default Re: Debugging SOAP Issue

    I have a simlar, but different problem. None of the functions like get_module_fields(), get_entry_list(), get_entries() will return the custom fields.

    Am I missing some configuration detail?

  5. #5
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Debugging SOAP Issue

    Hello math0ne,

    That error sounds like a general SOAP connection problem-- I'm not aware of it ever being specifically caused by custom fields. Can you confirm that the errors only started appearing after the custom fields were added? About how many custom fields have you added?

    dbischoff,

    Are the functions returning the fields correctly, just missing the custom fields? You shouldn't need to make any configuration changes to have them show up.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  6. #6
    dbischoff is offline Member
    Join Date
    Sep 2007
    Posts
    6

    Default Re: Debugging SOAP Issue

    Yes, Julian, I seem to have no problems getting the standard fields, but, for example, get_module_fields() only gets the standard fields, and none of the custom fields.

    I have also tried get_entry_list() and get_entries(). Any standard fields that I specify get returned, but not the custom fields. In get_entry_list($sess,"Accounts") I have tried variations of the field names, ie:'core_id_c' is a field in the accounts_cstm table, so I have tried core_id_c, core_id, accounts_cstm.core_id_c, accounts_cstm_core_id - none work

    I can however use a custom field in the query parameter, such as "accounts_cstm.core_id_c=55" or in the order_by parameter, such as "accounts_cstm.core_id_c ASC" and they work fine

    I have not tried to set any fields yet

    I'm using Professional Version 5.0.0beta1 (Build 2193)

  7. #7
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Debugging SOAP Issue

    Hello dbischoff,

    It's interesting that you're using 5.0beta -- I'm sure that has something to do with it, since this is definitely working in the stable 4.5.1 branch. I'll make sure our engineering team is aware of the problem-- and that the problem gets fixed before 5.0 GA is released.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  8. #8
    dbischoff is offline Member
    Join Date
    Sep 2007
    Posts
    6

    Default Re: Debugging SOAP Issue

    Julian, thanks for the very quick response. For now, I think I will just read the custom filed table directly from the database, while I await a potential fix to the SOAP interface.

    As I said, I haven't attempted a set_entry() yet. Hopefully it works on the custom fields. Iam more relucatnt to write to the database directly, because I don't know if I would be unknowingly bypassing some other internal Sugar process.

  9. #9
    dbischoff is offline Member
    Join Date
    Sep 2007
    Posts
    6

    Default Re: Debugging SOAP Issue

    Julian, I think I have confirmed that it is a 5.0beta issue. We have re-loaded 4.5 and tested our SOAP calls again. They appear to be working OK, we can get the custom fields.

    Thanks, again

  10. #10
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Debugging SOAP Issue

    Hey dbischoff,

    I'll make sure this is fixed before 5.0 GA is shipped.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SOAP login with LDAP issue
    By derekvincent in forum Developer Help
    Replies: 3
    Last Post: 2011-01-07, 06:58 PM
  2. Replies: 5
    Last Post: 2010-03-16, 02:30 PM
  3. SOAP Performance Issue Loading Accounts
    By artisticlight in forum General Discussion
    Replies: 1
    Last Post: 2007-07-20, 01:39 PM
  4. SOAP Issue
    By bobfejes in forum Developer Help
    Replies: 1
    Last Post: 2006-12-17, 06:45 PM

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
  •