Skip to content Skip to sidebar Skip to footer

Insert Values In Mysql Using Wcf Rest And Android

I wrote a REST web service in C#. Get request works fine, but insert, update and delete not. When I try to insert some values from an Android tablet (client) via the REST service i

Solution 1:

The first step would be to write a C# unit test that exercises the InsertUser method through the web service. When running this test I think you'd discover that your UriTemplate is incorrect. If you're making a POST, the json object will be in the body of the request, not in the url. I'd try an attribute like this:

[WebInvoke(Method = "POST", UriTemplate = "/users", 
    RequestFormat = WebMessageFormat.Json,       
    ResponseFormat = WebMessageFormat.Json]

Your android url would look like this (I think):

Stringurl= IP + PORT + "/users";

Another thing to check out would be Fiddler. When your unit test passes, you can inspect successful requests. Your android client can also be configured to use Fiddler.

Post a Comment for "Insert Values In Mysql Using Wcf Rest And Android"