• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Unable to call REST service with POST method

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Yeah, but is it art? What do you think tiny ad?
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic