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;

//Contructor
    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()
    {
        try
        {
            var soapString = this.constructRefreshsoap();
            client.DefaultRequestHeaders.Clear();
            client.DefaultRequestHeaders.Add("SOAPAction", "https://trolderuterne.play2know.dk/GetRoutes");
            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
            };
        }
        finally
        {
        }
    }

Best Answer

Answers

Sign In or Register to comment.