views:

287

answers:

4

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.
A: 

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.

Tai Squared
A: 

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.

mhenrixon
+2  A: 

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.

Dima
A: 

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.

Casey