Software Archive
Read-only legacy content
17061 Discussions

How to consume a webservice returning dataset (dot net) in android?

Navnath_Lanke
Beginner
1,184 Views

I don't know the scope of this forums!!!
But, can we put the questions regarding the developement?
If yes, I have one question here:

We can consume a webservice returning a scalar value,But
how we can consume a webservice returning a dataset (created in vb.net) from an android activity?

any kind of help is most appreciated.

0 Kudos
14 Replies
Alexander_W_Intel
1,184 Views
Which data format have your webservice?
If you able to control both sides(vb.net and Android) I would suggest using JSON, because it's supported by the official API:http://developer.android.com/reference/org/json/JSONObject.html
Alex
0 Kudos
Navnath_Lanke
Beginner
1,184 Views
Thanks a lot for the reply,
webservice is returning a dataset with multiple data tables having multiple rows and columns in each table.
so it is difficult to fit in name value pairs.
0 Kudos
Alexander_W_Intel
1,184 Views

JSON is not only a key:value store. You can put in hierarchical datain like:

[jscript]{ "table1"  :
     {
         "row1": 
          { "col1": "a string", "col_number": 25}, 
         "row2": 
          { "col1": "another string", "col_number": 55} 
     }
"table2"  :
     {
         "row1": 
          { "col_different_from_table1": "a string"}, 
         "row2": 
          { "col_different_from_table1": "another string"} 
     }
}[/jscript]

Many webservices like from Twitter and Facebook are using JSON.

Alex
0 Kudos
key_key
Beginner
1,184 Views
vsichko tova e mnogo interesno i si zaslujava da se pomisli nad nego :)
0 Kudos
Navnath_Lanke
Beginner
1,184 Views
Hi friend,
I didn't catch you, which is this language?
0 Kudos
IDZ_A_Intel
Employee
1,184 Views
Hi Alex,
Thanks a lot again for the response.
But I am new to use android and JSON. I have done only a couple of applications in android and never used json before. All i have worked before is in VB.Net and Sql Server.
I will be very thank full to you if you can share a step by step walk through or a part of code that
is declaring and using the webservice (from dot net ) returning dataset in android.
Thanks a lot in advance.
0 Kudos
Alexander_W_Intel
1,184 Views
Hi,
I never wrote code in VB.net so I could not give you a full example. But this post on Stackoverflow sounds very reasonable for me. All you have to do additionally in VB.net is to return the JsonString on a Web request.
On the Android side there is a good example how to do connect to a web service and convert the JSON on this page:http://www.vogella.de/articles/AndroidJSON/article.html
Hope this helps a bit more.
Alex
0 Kudos
Navnath_Lanke
Beginner
1,184 Views
Hi,
This will be fine while returning a single value from dotnet webservice, more over you can return an array too. But our main issue is how to deal with the dataset returned from the dotnet webservice.
Is there any code sample for the consuming dotnet webservices returning dataset?
if you have any code sample , please share with us, that can definitely help many of us.
0 Kudos
imby
Beginner
1,184 Views
you can see the following example
Create CXF Client
0 Kudos
tomorrowwillbefine
1,184 Views

The system repair function will windows 7 keys remove any updates you have previously installed that are not included on the CD. Any windows Drivers will also be reverted to their original XP versions, as well as some settings (network & performance settings may sometimes be reset to their defaults). It may be necessary to reactivate your Windows XP as well. When finished, you will microsoft office 2007 keys have to download all of the updates from Microsoft Windows Update, because they are all replaced during repair.

www.keyyeah.com

0 Kudos
tomorrowwillbefine
1,184 Views

The system repair function will windows 7 keys remove any updates you have previously installed that are not included on the CD. Any windows Drivers will also be reverted to their original XP versions, as well as some settings (network & performance settings may sometimes be reset to their defaults). It may be necessary to reactivate your Windows XP as well. When finished, you will microsoft office 2007 keys have to download all of the updates from Microsoft Windows Update, because they are all replaced during repair.

www.keyyeah.com

0 Kudos
Mohamed_helmi_b_
Beginner
1,184 Views
0 Kudos
Ahmed_Kchaou
Beginner
1,184 Views
0 Kudos
Neetesh_S_
Beginner
1,184 Views

Dear Sir, 

You can use Ksoap Library for parsing datatable in android

or you can use Json.net for parsing datatable to json object in .net

both of these are free and easy to use.

0 Kudos
Reply