0

Hi Everyone, How to call asp.net web service using android my web service is having fnsendsms(phoneno,message) on click of sendsms button i want to call fnsendsms function how to call that using java for that i have to download any jar files please help me thanks.

1 Answer 1

1

First, download ksoap2 android jar. Then you can call web service like:

     SoapObject request = new SoapObject(YOUR_CONNECTION_NAMESPACE, methodName);

            //add parameters to web service method..
        request.addProperty(parameterName, parameterValue);

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

        HttpTransportSE androidHttpTransport = new HttpTransportSE(YOUR_CONNECTION_URL);
        androidHttpTransport.call(YOUR_ACTION_NAME, envelope);

        result = (Object) envelope.getResponse();
Sign up to request clarification or add additional context in comments.

4 Comments

I downloaded ksoap2 android jar files how to add these file resources to my project please help me?
Right click to your project folder in Eclipse. Click properties, then java build path > libraries > add external jar.
after that when i call envelope.response() it is giving following exception how to fix this org.ksoap2.SoapFault please help me
What is the exception? Please debug or look at the logCat.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.