Hi,
I'm using the SugarCRM web service to retreive data from SugarCRM and store it in Evolution Mail.
However, it seems to me this service is really slow as compared to other XML WebServices I've used.
At some point I was even considering to create my own XML WebService to retreive data directly
from the SugarCRM database, but instead I'd rather solve this problem.
Is anybody else using the WebService to retreive data ?
Do you have the same problem ?
Getting 600 contacts, in groups of 20 (to prevent a timeout during the get_entry_list call)
takes up the better part of an hour.
A code sample. For example, the code is called by the GetContacts() method on the client until
all contacts have been received, hence the Offset parameter. I'm aware limiting the maxresults
to 20 causes at least 30 round trips, but increasing this value causes timeouts.
Please note this is tested on a server with 100Mbps upload and 100Mbps download capacity
and the client can upload at 512kbps and download at 4Mbps.
The result is the same on both Windows (.NET 2.0) and Linux (Mono)
Any ideas, feedback, etc... would be welcome.Code:private int getNextEntries(string Module, string[] Fields, string Query, string OrderBy, int Offset, int MaxResults, bool GetDeleted, ref DataTable Entries) { //Set the number of records to get for each request int maxResultsInLoop = (MaxResults < 20 ? MaxResults : 20); //Get the first results Console.WriteLine("Getting next entries. [{0}]",System.DateTime.Now.ToShortTimeString()); get_entry_list_result entryList = this.sugarClient.get_entry_list(this.sessionId, Module, Query, OrderBy, Offset, Fields, maxResultsInLoop, Convert.ToInt32(GetDeleted)); if (entryList.result_count > 0) { foreach (entry_value entry in entryList.entry_list) { //Create a new DataRow DataRow entryRow = Entries.NewRow(); //Loop trough the columns foreach (name_value value in entry.name_value_list) { entryRow[value.name] = value.value; } //Add the DataRow to the DataTable Entries.Rows.Add(entryRow); } return entryList.next_offset; } else { return -1; } }
Thank you.


LinkBack URL
About LinkBacks



Reply With Quote



Bookmarks