2
votes

I am looking for any insight/direction on designing a simple web service. I would love to hear some thoughts on how to quickly get started, and what pitfalls to avoid. To simplify, here are the basics I'm looking to accomplish:

  • Service should provide a simple database query and multi-value response.
  • Service should provide a simple multi-value database insert.

Assuming use of open source tools, how should I begin on the server side? Given a MySQL database and HTTP web server (Apache), then there needs to some simple logic to connect to the database.

  1. Does any one language stand out as being best suited for this? (Java, C, Perl, Python, Ruby, PHP) I prefer Python, but are there performance concerns?
  2. Is it worth it to use an application server, or is that just overkill? (Tomcat, Axis, Django, ...)
  3. What other frameworks are out there to consider (CherryPy, TurboGears, RoR, ...)
  4. Is there any benefit using SOAP/REST and/or WSDL?
  5. How can I prevent spammers from performing bogus inserts.
4
I think you could shift this around a little bit and make it a code golf like questions. What is the shortest Web Service you can write that replies to the string "1" with Hello Word. There are no best tools as is outlined below.ojblass
This question is really too vague. What you are asking is "What language should I write a desktop application in?" Web service is still on the general side of types of applications.jmucchiello
Sometimes the "Hello World" answer does not usually translate well to a correct solution, so I was trying to be more specific. Also, I am not looking for the technical "how is it done" answer, but what is the correct approach given the hundreds of software project that all target this same issue. If you think the answer is "it doesn't matter, just pick anyone" then so be it.cmcginty

4 Answers

2
votes

Have a look at Hessian from Caucho. It's a really wonderful light weight protocol. After I discovered it for myself, I almost cried about those torturous days I wasted on SOAP, WSDL and the like. A service can be a really trivial POJO (if you're in java) wired by Spring and exposed through web server. Making services never been easier ever since.

0
votes

What languages/tools are you and your team most familiar with? You can create a web service using any number of languages, but if you are already proficient in one or the other, why not choose that?

Some languages are better than others at certain tasks, so it depends on your goals. If you are looking for a task to learn a new language, pick one. If you need to get something deployed within a short timeframe, something you already know should be faster, even if it isn't the "best" language for the task. There are typically no "best" tools for any application, just how you use them and make something worth using.

0
votes

Personally I would use a self hosted WCF service probably. Depends on what you are going to use it for. Maybe an asp.net hosted WCF service.

0
votes

Information I have come across:

Application Servers
I think a standard Application Server is probably not necessary for this task. Wikipedia has a comparison of application servers.

Web Application Frameworks
A web application framework can be utilized to provide database access and other features need by a web service. Wikipedia has a comparison of well-known frameworks for various languages.

There is also a specific list of web service frameworks. These implement some of the WS protocols, but also I think is too heavy-weight for a simple web service.