ksoap2 response 404 on android application

67 Views Asked by At

We have a soap web service in our company and it is reachable from desktop browser and Soap-UI, but wen calling the web service from our android application, we get 404! Does anyone has idea why this is happening?

Our application was OK but the network team made some changes and now the don't accept the responsibility

String SOAP_ACTION = SOAP_ACTION_PART_ONE + METHOD_NAME;

        //Create request
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

        PropertyInfo propInfo1 = new PropertyInfo();
        propInfo1.setType(String.class);
        propInfo1.setName("userName");
        propInfo1.setValue(userName);
        request.addProperty(propInfo1);

        PropertyInfo propInfo2 = new PropertyInfo();
        propInfo2.setType(String.class);
        propInfo2.setName("password");
        propInfo2.setValue(password);
        request.addProperty(propInfo2);


        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;

        //Set output SOAP object
        envelope.setOutputSoapObject(request);

        //Create HTTP call object
        HttpTransportSE androidHttpTransport = new HttpTransportSE(url);

        androidHttpTransport.debug = true;

        try {
            androidHttpTransport.call(SOAP_ACTION, envelope);
            Log.d("TAG", "HTTP REQUEST:\n" + androidHttpTransport.requestDump);
            Log.d("TAG", "HTTP RESPONSE:\n" + androidHttpTransport.responseDump);

            //Get the response
            SoapObject response = (SoapObject) envelope.bodyIn;
            return ScanSoapObject(response);

        } catch (Exception e) {
            e.printStackTrace();
            AuthenticateUserResponse authenticateUserResponse = new AuthenticateUserResponse();
            ErrorModel errorModel = new ErrorModel();
            errorModel.setCode(-10);
            errorModel.setMessage(context.getString(R.string.no_connection_to_server));
            authenticateUserResponse.setErrorModel(errorModel);
            return authenticateUserResponse;
        }
0

There are 0 best solutions below