• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to call REST service with POST method  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am implementing AsyncTask to consume a REST service.
When I invoke the service I am getting the error java.io.FileNotFoundException: https://www.testurl.in/service.php.
Can you please help me what is wrong with this code.

 
Master Rancher
Posts: 2580
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am getting the error


Can you post the full stack trace that shows where the error happened?
Add a call to printStackTrace to get the stack trace.
 
mohana krishna
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Norm Radder,

Thanks for your reply.I am getting exception at line number 17 when i run in debug mode.

           
tried with ex.printStackTrace(); to print stace strace buy i can not see message in Android monitor or Android device monitor log cat.
 
Norm Radder
Master Rancher
Posts: 2580
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange the stack trace does  not show in the logcat.  Where did you add the call to the printStackTrace?  All catch blocks should have the call.
 
mohana krishna
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Norm Radder,

Finally i am able to solve the issue , also i am able to read print stack trace.

I modified the code to read status of the response.



With the above code i came to know that request is not reaching the REST web service.
So i modified the URL with the service name with following code modification system is working as expected.



Thanks for your prompt replies.

Regards,
Mohan.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!