This may or may not help anybody, but here are my observations so far.
I added a console project to the plugin solution, in Visual Studio 2015, so I could attempt to understand what is happening.
The console app looks like this - basically just creating a session and doing a login.:
namespace addinConsole
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Starting the console app. Not doing much of anything.”);
SuiteCRMClient.clsSuiteCRMHelper.SuiteCRMUserSession = new SuiteCRMClient.clsUsersession(@"http://vapp:8080/suitecrm/", "bjoel", "frog", "");
var pwd = SuiteCRMClient.clsSuiteCRMHelper.SuiteCRMUserSession.SuiteCRMPassword;
var uid = SuiteCRMClient.clsSuiteCRMHelper.SuiteCRMUserSession.SuiteCRMUsername;
SuiteCRMClient.clsSuiteCRMHelper.SuiteCRMUserSession.Login();
//SuiteCRMClient.clsSuiteCRMHelper.SuiteCRMUserSession.LogOut();
Console.ReadKey();
}
}
}
When the client tried to read the stream, I found I was getting this text in the stream - you may notice that the actual JSON starts way down the text, and this would also account for the unidentified characters at the beginnng of the stream, when parsing for JSON:
“”
\nWarning: Declaration of SugarWebServiceUtilv4::get_data_list($seed, $order_by = ‘’, $where = ‘’, $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0, $favorites = false) should be compatible with SugarWebServiceUtilv3_1::get_data_list($seed, $order_by = ‘’, $where = ‘’, $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0, $favorites = false, $singleSelect = false) in C:\inetpub\wwwroot\SuiteCRM\service\v4\SugarWebServiceUtilv4.php on line 555
\n
\nWarning: Declaration of SugarWebServiceImplv4::get_entries($session, $module_name, $ids, $select_fields, $link_name_to_fields_array) should be compatible with SugarWebServiceImplv3_1::get_entries($session, $module_name, $ids, $select_fields, $link_name_to_fields_array, $track_view = false) in C:\inetpub\wwwroot\SuiteCRM\service\v4\SugarWebServiceImplv4.php on line 49
\n
\nWarning: Cannot modify header information - headers already sent by (output started at C:\inetpub\wwwroot\SuiteCRM\service\v4\SugarWebServiceUtilv4.php:555) in C:\inetpub\wwwroot\SuiteCRM\service\core\REST\SugarRestJSON.php on line 59
\n{“id”:“1d1488c75e1e6e3123d01ce0f08815e5”,“module_name”:“Users”,“name_value_list”:{“user_id”:{“name”:“user_id”,“value”:“5ed94a45-81b7-6039-8468-57475839cb07”},“user_name”:{“name”:“user_name”,“value”:“bjoel”},“user_language”:{“name”:“user_language”,“value”:“en_us”},“user_currency_id”:{“name”:“user_currency_id”,“value”:"-99"},“user_is_admin”:{“name”:“user_is_admin”,“value”:false},“user_default_team_id”:{“name”:“user_default_team_id”,“value”:null},“user_default_dateformat”:{“name”:“user_default_dateformat”,“value”:“m\/d\/Y”},“user_default_timeformat”:{“name”:“user_default_timeformat”,“value”:“h:ia”},“user_number_seperator”:{“name”:“user_number_seperator”,“value”:","},“user_decimal_seperator”:{“name”:“user_decimal_seperator”,“value”:"."},“mobile_max_list_entries”:{“name”:“mobile_max_list_entries”,“value”:null},“mobile_max_subpanel_entries”:{“name”:“mobile_max_subpanel_entries”,“value”:null},“user_currency_name”:{“name”:“user_currency_name”,“value”:“US Dollars”}}}""
So I wrote a method to convert the stream to a bytearray, and look for the “{” character, then passed that index into the stream reader, which effectively drops the warning messages from the front of the stream. I also had to switch to a memory stream, since the plain old stream doesn’t appear to support position…
Like I say, i don’t know of what use this will be to anyone.I don’t yet know what use it will be to me, but maybe brighter minds than mine will be able to identify a plan of attack.