Exception timeout in my application.

askorotaevaskorotaev RUMember
edited January 2016 in Xamarin.Android

Hello!
I have an application for Android with SOAP Service. I use Web Reference to connect to this service. A few time ago I updated Xamarin version and got a problem.
At the start of work service work fine but after 5-10 minutes there is RequestTimeout exception raised at the client. I found out than no data send to SOAP service.
Here is my code to send request to service:

{
private void testSend() {
            try {
                Offline offline = new Offline ();
                offline.Timeout = 10000;
                offline.SaveLogToSQL ("Test Offline", "Test Offline", "");
                var Url = SettingsHelper.WebServiceUrl ();
                var sp = System.Net.ServicePointManager.FindServicePoint(new Uri(Url));
                sp.CloseConnectionGroup(offline.ConnectionGroupName);


            }catch (Exception ex){
                LogService.AddLogErr ("Error test", massegeErr);
            }
        }
}

Server at the local network.

I tried this stuff but in doesn't work:

var Url = SettingsHelper.WebServiceUrl ();
                Android.Net.ConnectivityManager cm = (Android.Net.ConnectivityManager)GetSystemService (
                    Android.Content.Context.ConnectivityService );
                var sp = System.Net.ServicePointManager.FindServicePoint(new Uri(Url));
                sp.CloseConnectionGroup(null);

here is stack trace

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x000b0] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:361 
  at XOFFLINE.OfflineService.Offline.SaveLogToSQL (System.String FIO, System.String message, System.String Stack) [0x00001] in path\Web References\OfflineService\Reference.cs:299 
  at (wrapper remoting-invoke-with-check) XOFFLINE.OfflineService.Offline:SaveLogToSQL (string,string,string)
Sign In or Register to comment.