jQuery in Action, 2nd edition*
The moose likes Web Services and the fly likes New To Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "New To Web Service" Watch "New To Web Service" New topic
Author

New To Web Service

Supraja Kannaiyan
Ranch Hand

Joined: Mar 09, 2007
Posts: 41
Hi,

I am new to Web Service.Please suggest me a environment for starting off with the development of Web services.

Thanks in Advance,
Supraja
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
What are your requirements? What are you wishing to accomplish?

Have a look at web services tutorial? to see what kind of issues need to be clarified.
Supraja Kannaiyan
Ranch Hand

Joined: Mar 09, 2007
Posts: 41
Hi,

Thanks for your reply. I would like to develop a webservice in Java. It Should access the data from the SQL Server database and return the data based on the parameter passed by the client.This is my Requirement.


Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
Reading DB in web service is no different than any type of Java application.


My Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
A standard servlet container (like Tomcat) and a WS toolkit to run on top of it would be needed. For SOAP-type services, Apache Axis 2 is a good choice, while for REST-type services the Jersey library can be used.


Ping & DNS - my free Android networking tools app
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Supraja Kannaiyan wrote:I would like to develop a webservice in Java.

So you have chosen the implementation platform for your service (but not: (1) the version of Java (which may limit the web service platform that you can use), (2) the web service technology (SOAP, XML(or JSON) over HTTP, XML-RPC, RESTful etc.) or even (3) the web service platform (Axis, Axis2, Apache CXF, JAX-WS RI, Jersey, Restlet, etc.).

It Should access the data from the SQL Server database and return the data based on the parameter passed by the client.

That is what you want to do inside the service and hopefully want to "hide" from the service consumer.

What about the "requirements" of the service consumer? The service has no reason for existing without its service consumers. Is there only one single consumer? Are there many consumers? Are there many consumer types? Are the consumers accessing the service across an intranet, across firewalls, across the internet? What data format (or media types) can the service consumers "consume" (text, XML, JSON, SOAP (rpc/encoded, rpc/literal, document/literal), etc.). What kind of security is needed (user authentication, transport level security, message level security, etc.) ?

Are there any other constraints that you are working against?
Supraja Kannaiyan
Ranch Hand

Joined: Mar 09, 2007
Posts: 41
Hi,

Many Consumers will be accessing the web service across the Internet.Data Format is SOAP.User Authentication is needed.

Thanks for your Reply,
Supraja
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
What version of Java (1.3, 1.4, 5+) will you be using?

Why did you decide to go with Axis 1.x rather than Axis2?

Are you intending to use WS-Security for User Authentication? WS-Security is the proper way to secure a SOAP web service - however some SOAP capable consumers are not WS-Security capable.

Why did you decide that a SOAP web service is the best fit for your particular application?
Supraja Kannaiyan
Ranch Hand

Joined: Mar 09, 2007
Posts: 41
Hi,

I am using Java1.5. I am using Eclipse tool which uses Axis 1.3 version. Since I dont have much knowledge about web service, I have chosen SOAP based web Services blindly.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
While Axis 1.x is simpler, using Apache Axis2 would probably be a safer choice (Rampart implements WS-Security for Axis2). Axis2 has the nice option of using JiBX for XML binding, which is useful if you have pre-existing XML Schemas that need to be bound to pre-existing Java Objects.

IDE support shouldn't really be a deciding factor when choosing a SOAP web services stack because it is more important that it works after deployment.

As you are using Java 1.5 you can use JAX-WS which is the current (Sun) standard API for building Java-based SOAP web service providers and consumers. It uses JAXB for XML binding. JAX-WS and JAXB are a standard part of the JDK 1.6. JAX-WS is part of the Metro web service stack that focuses "on reliable, secured, and transacted web service interoperation, including those with .NET services". If you require an IDE NetBeans can use JAX-WS "out of the box".

Java 1.5 should also allow you to use Apache CXF.

Given the choice of SOAP web service stack I'd go with JAX-WS - but that is just my personal choice.

How was it established that you need a SOAP web service in the first place?
See: RESTful HTTP web services vs. Big Web Services (SOAP/WSDL)
Supraja Kannaiyan
Ranch Hand

Joined: Mar 09, 2007
Posts: 41
Hi,

Thanks for your reply. As I have already told that I dont have much idea about web services, I have chosen Soap based web services. What are the various technologies using which we can develop Web Services?

Thanks,
Supraja
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Supraja Kannaiyan wrote:What are the various technologies using which we can develop Web Services?


Current generation Java-based "Web service" (i.e. SOAP/WSDL) stacks: JAX-WS, Apache Axis2, Apache CXF (formerly Codehause XFire)

Previous generation Java-based SOAP stacks which include (not necessarily interoperable) SOAP encoding support: JAX-RPC, Apache Axis 1.x

Some of the current generation Web service stacks (JAX-WS, Axis2) also include support for "XML/HTTP" binding - transporting XML data over HTTP without SOAP envelopes.

SOAP wasn't designed to be used exclusively over Web, even though the name "Web services" may imply that. In fact "Web services" don't really operate in a manner that can take advantage of the inherent characteristics of the Web. "Web services" practice message-based/document-oriented RPC - "the Web" is all about "resources" - it is a REST architecture. So in 2002 (4 years after SOAP was designed) the concept of RESTful web services was formulated.

SOAP's popularity is based on
  • the fact that developers are comfortable with the RPC concept
  • the availability of code-generation tools for it
  • its extensibility which gave rise to the numerous WS-* standards
  • it being used as the key enabling protocol for many SOA foundation software products (for which the hype finally seems to be plateauing).

  • However more and more web sites are realizing that they do not need the flexibility (and associated complexity overhead) of SOAP and WS-* for their "Service-over-the-Web" which explains why RESTful web services are becoming more popular.

    XML for PHP developers, Part 3
    Yahoo chose REST because of a common belief among developers that REST offers 80% of SOAP's benefits at 20% of the cost.

    Other development communities (Ruby, Perl, PHP) seem to have all but given up on SOAP after the it became apparent that "SOAP encoding" couldn't be interoperable.

    Java-based RESTful web service frameworks: Jersey (JAX-RS (JSR-311)), Restlet.

    RESTful HTTP web services vs. Big Web Services (SOAP/WSDL)

    For more information see the Web Services FAQ
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: New To Web Service
     
    Similar Threads
    Cannot see web project option in eclipse 3.6
    web services
    orion 2.0 released
    Can't setup basic spring application
    Need HTML And Javascript Code