java.io.IOException: Unexpected end of stream on com.android.okhttp.Address@

Viewed 84

I have an native android app. For Api, we have used soap web service. My method kind of look like this-

public String callApi(String a,
                                String b,
                                String c) {

    Object objLoginResponse = null;
    String response = "";
    try {
        final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        String METHOD_NAME = "Do_Something";
        String SOAP_ACTION = "http://www.bdmitech.com/m2b/Do_Something";
        SoapObject request = new SoapObject(GlobalData.getStrNamespace(), METHOD_NAME);
      

        request.addProperty("A", a);
        request.addProperty("B", b);
        request.addProperty("C", c);

        envelope.dotNet = true;

        envelope.setOutputSoapObject(request);
        envelope.implicitTypes = true;
        HttpTransportSE androidHttpTransport = new 
        HttpTransportSE(GlobalData.getStrUrl().replaceAll(" ", "%20"), 180000);
        androidHttpTransport.call(SOAP_ACTION, envelope);
        objLoginResponse = envelope.getResponse();
        response = objLoginResponse.toString();
        
    } catch (Exception exception) {
        
       
            response = "Sorry for Inconvenience.";
            
      
       
    }

    return response;

}

Sometimes this line >>"androidHttpTransport.call(SOAP_ACTION, envelope);" throws the above mentioned error and sometimes it doesn't. Can Anyone tell me what is causing the error or how to solve it.

0 Answers
Related