• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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: 3276
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: 3276
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!