Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

SOAP webservice used to work, but now it doesn't work on any device below Android 6.0 - Help!

TroelsThistedTroelsThisted DKMember ✭✭
edited May 2016 in Xamarin.Forms

Suddenly i got reports form user that a list in my app didn't show any data - It worked fine on my device. Later i found out that everything works fine and dandy on all android devices with 6.0 installed - every android version below 6.0(Marshmallow), wont get data transferred! I am at a loss - have no idea what has happened or how to fix this.... HALP!

Does any1 recognize this or have possible solution to how this can be fixed?

In my forms app i have a portable library where i have a class handling the SOAP webservice, it is implemented like below:

    //private Uri baseUri = new Uri("uri");
    private static DataConnection _instance = null;
    private HttpClient client = null;

    private DataConnection()
        client = new HttpClient(new NativeMessageHandler());
        client.BaseAddress = baseUri;
    public static DataConnection Instance { get { if (_instance == null) _instance = new DataConnection(); return _instance; } }

    public async Task<Other.ServiceResponse> RefreshRouteList()
            var soapString = this.constructRefreshsoap();
            client.DefaultRequestHeaders.Add("SOAPAction", "");
            var content = new StringContent(soapString, Encoding.UTF8, "text/xml");

            using (var response = await client.PostAsync("/Classes/mobileServices.asmx", content))
                if (response.IsSuccessStatusCode)
                    var soapResponse = await response.Content.ReadAsStringAsync();
                    return JsonConvert.DeserializeObject<Other.ServiceResponse>(ParseSoapResponse(soapResponse));
                return new ServiceResponse { Code = Codes.ServerError, Message = response.StatusCode.ToString() };
        catch (Exception ex)
            return new ServiceResponse
                Code = Codes.ServerError,
                Message = ex.Message

Best Answer


Sign In or Register to comment.