Marquinio
Marquinio

Reputation: 473

Creating a Java based web service

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.

Upvotes: 0

Views: 1849

Answers (4)

Ramson Mwangi
Ramson Mwangi

Reputation: 135

I think you would need axis for this one. But I'll advice you to look at Apache CXF, if in future you will need more support with web service apps. CXF just like axis2 is an implimentation of jax-ws but with an advantage of supporting jax-rs (rest). This means you can expose both REST and SOAP web service interfaces.

Upvotes: 0

Buhake Sindi
Buhake Sindi

Reputation: 89189

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).

Upvotes: 2

Mike Baranczak
Mike Baranczak

Reputation: 8374

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

Upvotes: 2

Stefan Kendall
Stefan Kendall

Reputation: 67882

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.

Upvotes: 1

Related Questions