开发者

How to call asp.net web service in android java?

开发者 https://www.devze.com 2023-03-17 01:35 出处:网络
Hi Everyone, How to call asp.net web service using android my web service is having fnsendsms(phoneno,message) on click of sendsms 开发者_如何学Gobutton i want to call fnsendsms function how to call t

Hi Everyone, How to call asp.net web service using android my web service is having fnsendsms(phoneno,message) on click of sendsms 开发者_如何学Gobutton 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.


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消