Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!
  • 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.

 
Rancher
Posts: 3171
33
  • 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
Rancher
Posts: 3171
33
  • 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.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!