• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Help with REST web service

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello members,

I am developing an android app! Thought of using REST webservice with PHP to connect with remote database. I am a newbee to this. anybody with some example code on connecting login table with REST & PHP would help me a lot...

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A RESTful web service does not care where the requests come from so the fact that Android is involved is not important.

The real question is, what on the server that can talk to a database is under your control??

Bill
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's so nice Brodgen.

can you give me some examples on REST to connect to a remote database...?
 
Saloon Keeper
Posts: 7632
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As mentioned else where in another question you asked, DBs are not accessible via HTTP. You'll need to route the call through an HTTP server. One possibility would be a servlet container like Tomcat that runs the RESTful service using a library such as Jersey.
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim Moores thanks a lot..

Any other possibilities of accessing the DB's through HTTP server?? please mention so that i can select the best and easy one for me!!
 
Tim Moores
Saloon Keeper
Posts: 7632
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's best for you depends on lots of circumstances about which we know nothing. Maybe start by telling us why you think the approach I mentioned might not be a good one in your situation.
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no clue about library Jersey. I have time to complete project. Let me finish with the easiest things.

Would you tell me how to call a webservice from android...?
 
Tim Moores
Saloon Keeper
Posts: 7632
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Calling a RESTful WS from Android is pretty easy, as it has the capable Apache Commons HttpClient library built in. There are lots of example on how to use it around on the web; there's nothing Android-specific about it.
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes understood. Thanks a lot people. I also studied some books and got help from frnd.
How to consume webservices in java?
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Charan Kumar Br wrote: How to consume webservices in java?



That depends on the web service, doesn't it?

SOAP web services typically publish a WSDL which can be used to create a client.

RESTful web services typically publish a text description and example client code.

Bill
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
fine. how to consume RESTful webservices on java??? If any example code, please send me..
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Charan, I would suggest, you please read the basics about web serivces before consuming/building it.
 
Tim Moores
Saloon Keeper
Posts: 7632
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Charan Kumar Br wrote:how to consume RESTful webservices on java??? If any example code, please send me..


Did you read my previous reply? What further questions do you have?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
There are many web service tutorials, including for RESTful web services, here: http://netbeans.org/kb/trails/web.html
Best wishes!
 
Charan Kumar Br
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ivan!!
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic