views:

62

answers:

3

Hello,

I have a very basic Java based web service requirement. Requirement is very simple, pass some String parameters, save them to database and generate a response ("success", "failed"). There is also a case where I need to return simple XML representation (SOAP message) of a simple Object:

<person>
 <name>the name</name>
 <address>the name</address>
......
</person>

Our current environment is Windows, Apache Tomcat 5, SQL Server. I'm new to web services so I'm trying to figure out what technologies I could use to make this work. For example:

  1. Do I really need Apache Axis 2 to implement this or would it be overkill?

  2. I saw a tutorial online where all that was needed to create web service was Eclipse, Lomboz plugin for Eclipse and Apache Tomcat. Will I still need Apache Axis2 if I take this route?

  3. Is it possible for Tomcat to process web service requests messages or do I need third party libraries?

I guess I'm looking for the easiest way to implement this. Thank you.

+1  A: 

A web framework would make this much easier (and actually maintainable), but you could just write a raw servlet to handle requests. You'll want to use an XML object serialization method, though, or at the very least an xml parsing library.

Stefan Kendall
Alternatively, JSON is also a good format for interchanging data; others already mentioned JAX-RS (Jersey, RESTeasy, Wink) which works well with both XML and JSON.
StaxMan
+1  A: 

Do you actually need SOAP support? If you do, Axis is probably your best bet. Otherwise, I'd take a look at Jersey.

Mike Baranczak
+2  A: 

If it will be as simple as you have mentioned, why don't you look at RESTful Web Services? You can specify your resource calls through a GET, POST, DELETE or PUT HTTP methods.

There's a blog tutorial on how to achieve this. It also shows you how you can return JSON strings/XML (depending on what you want).

The Elite Gentleman
Yeah this one looks like a good solution for me. I also believe it has support for SOAP messages? If yes then why would we need Apache Axis2?
Marquinio
Java 6 now have tools to facilitate developers in creating JAX-WS client/WSDL. You can create custom XML messages in RESTful applications. That all depends on your specification.
The Elite Gentleman