I\'m trying to call a simple JSON webservice with a parameter in objective c. Doesn\'t work so far.
Here is the web service method:
[WebMethod]
[ScriptMe
For the iOS part,
Your code looks OK. There should be no problem on the client side. But you can do the following debuggings;
sendSynchronousRequest:returningResponse:error
insert a breakpoint and check if your jsonData is valid. Because you are not checking the error
you assigned for JSON Serialization.Cheers
in the node
of web.config add the next lines:
<system.web>
<webServices>
<protocols>
<add name="HttpPost"/>
</protocols>
</webServices>
http://support.microsoft.com/default.aspx?scid=kb;en-us;819267
I had a similar problem. I was setting the HTML body with jsonData as you do and it didn't work. It turned out that the JSON service wasn't configured as it was supposed to be.
So, instead of setting the HTML body, try calling the URL like a GET method.
I mean, remove the lines that you set the HTML body, and change the URL to
http://localhost:8080/ListrWS.asmx/LogIn?username=usernameTest&password=passwordTest
Don't change the method (POST).
If this works, you will have to do some work on the server side.