Reputation:
i have created a login WCF service that is tested successfully using fiddler and postman tool..!
If the login process is success then WCF will give the json message as above screenshot. But when i posted username and password from android it gives the result as [{"message":"not created","success":-1}].i cant figure it out where the bug actually is.!! i am providing the corresponding android code and logcat below.please help me If the login process is success then WCF will give the json message as above screenshot.
But when i posted username and password from android it gives the result as [{"message":"not created","success":-1}].i cant figure it out where the bug actually is.!!
i am providing the corresponding android code and logcat below.please help me
If the login process is success then WCF will give the json message as above screenshot.
But when i posted username and password from android it gives the result as [{"message":"not created","success":-1}].i cant figure it out where the bug actually is.!!
i am providing the corresponding android code and logcat below.please help me
below is webservice code in android
Upvotes: 1
Views: 314
Reputation: 38439
try below code:-
HttpClient client = new DefaultHttpClient();
HttpConnectionParams.setConnectionTimeout(client.getParams(), 60000);
HttpResponse response;
try
{
JSONObject j = new JSONObject();
j.put("UserName", "hiqmaali");
j.put("Password", "qwerty");
Messages.onLowmemory();
HttpPost post = new HttpPost(HOST_URL);
StringEntity stringEntity = new StringEntity(j.toString(), "UTF-8");
post.setEntity(stringEntity);
response = client.execute(post);
In your case send json to server so u have to try above way.
Upvotes: 2