开发者

How to connect to a webservice using Soap in Android?

开发者 https://www.devze.com 2023-03-31 22:13 出处:网络
I\'m using HttpGet method for retrieving data from a web service in my Android app. Following is the code I\'m using right now.

I'm using HttpGet method for retrieving data from a web service in my Android app. Following is the code I'm using right now.

    String url = URLEditor.encode("http://"+Constants.strURL+"Orders.asm开发者_开发知识库x/CheckWebConnection? TechCode="+username+"&TechPIN="+password); 
    HttpClient httpClient = new DefaultHttpClient(); 
    HttpGet httpGet = new HttpGet(url);  
    response = httpClient.execute(httpGet); 
    HttpEntity entity = response.getEntity(); 
    if(entity == null) return false;  
    is = entity.getContent(); 

But, HttpGet method doesn't respond properly now and I'm asked to change the method. Web service doesn't support HttpPost. How can I do the same operation using Soap? Do I need to download any library and attach to Eclipse? Please help me


Download ksoap2. You will find lots of help with it including in stackoverflow, starting with :

How to call a .NET Webservice from Android using KSOAP2?

0

精彩评论

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