Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
kernel null
Old
#1  
Member - OP
Thanks Meter 0
Posts: 36
Join Date: Sep 2010
Location: San Antonio
Default [Q] [APP]org.JSON .NET Web Service

I'm hosting a .net Web Service and want to retrieve this using org.JSON.JSONArray. I did a little tutorial and was able to get twitter/timeline.json... no problem...

My Experience with web services has always been soap action, soap methods and all that garbage... my URL is a webservice.asmx...

My question is how do i call my .asmx web service using JSON

the tutorial: very simple
Code:
try
    	{
        	URL url = new URL("http://twitter.com/statuses/public_timeline.json");    		
        	URLConnection tc = url.openConnection();
        	BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));
        	String line;
        	while ((line = in.readLine()) != null)
        	{
        		JSONArray ja = new JSONArray(line);
        		
        		for (int i = 0; i < ja.length(); i++)
        		{
        			JSONObject jo = (JSONObject)ja.get(i);
        			myArray.add(jo.getString("text"));
        		}
        	}
    	}
    	catch(Exception e)
    	{
    		
    	}
 
kernel null
Old
#2  
Member - OP
Thanks Meter 0
Posts: 36
Join Date: Sep 2010
Location: San Antonio
I've looked at other methods such as HttpClient, WCF... I'm using Ksoap2, that works good enough, but i was looking for something a bit more RESTful... any thoughts? I just need a little help.
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...