Hello,
Try this..
JSONObject jObject = null;
String Url = "Here ur wcf url";
try {
HttpPost request = new HttpPost(Url);
List<NameValuePair> postParameters = new ArrayList<NameValuePair>();
JSONArray datjsonArray = new JSONArray();
JSONObject obj;
JSONObject jsonArray = new JSONObject();
for(int i = 0; i<list.length; i++){
obj = new JSONObject();
obj.put("name", list[i].name);
obj.put("age", list[i].age);
datarr.put(obj);
}
jsonArray.put("user", datjsonArray);
postParameters.add(new BasicNameValuePair("collection",
jsonArray.toString()));
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postParameters);
request.setEntity(entity);
HttpResponse response = getThreadSafeClient().execute(request);
entityResponse = response.getEntity();
result = EntityUtils.toString(entityResponse, HTTP.UTF_8);
On Mon, Jul 23, 2012 at 2:47 PM, Meena Rengarajan <[email protected]>wrote:
> Even send me too , please am too searching for a long time .
>
> Thanks ,
> Meena
>
> On Wed, Jul 18, 2012 at 2:19 PM, דבורי מאיר <[email protected]> wrote:
>
>> hi all,
>> I'm trying to send json array to wcf but getting bad request.
>> please, could anyone send me a work example of the two sides-android and
>> wcf?
>> i'm spending several days with searching and find nothing, please help
>> me!!!
>> thanks in advance
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
-----
Thanks & Regards,
M VIJAYAKUMAR
Contact : 09048382536 || http://iamvijayakumar.blogspot.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en