Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Web Services Container

I have just started learning Java Web Services ( JAX-WS ) and have one question. The reference documentation always talks about Web Services container. My question is : What is a Web Services container and why do we need it. I saw a simple example of JAX-WS in book "java web services up and running" where the web service is published using:

Endpoint.publish("http://127.0.0.1:9876/ts", new TimeServerImpl());

This example did not require me to host a web service in a Web Server / App Server or any container.

and I was also able to access this web service.

So what is a container, why do we need it for web services?

like image 751
user150014 Avatar asked Aug 13 '09 15:08

user150014


People also ask

What is a container in Web service?

The concept of a Web Services Container is a layer of abstraction that holds the enterprise-wide services, which are exposed as Web Services. This draws a parallel to the J2EE container for managing enterprise beans. It maintains a pool of Web Service Beans that services the requests from the request queues.

What is service container Java?

Containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before a web, enterprise bean, or application client component can be executed, it must be assembled into a Java EE module and deployed into its container.


2 Answers

Basically you just need something that can run Java servlets. Typical examples are Tomcat, Glassfish, JBoss, Jetty and many others.

Of these Tomcat is the lightest weight as it is "only" a servlet container (JBoss and Glassfish are J2EE application servers) and is the reference implementation for the servlets specification. You'll find lots of IDE integration and tutorials that use it too.

like image 197
cletus Avatar answered Oct 22 '22 04:10

cletus


The web service specification implementation by the various vendors( Websphere,Weblogic, JBoss) are through a servlet and you would need a servelet container to support this servlet. This servlet is specifically designed to handle SOAP based traffic (HTTP traffic with SOAP headers and body) rather than plain HTTP based POST/GET that you send from browsers.

like image 1
zkarthik Avatar answered Oct 22 '22 06:10

zkarthik