Web services are to a great extent in the spirit of SOA. Most web services frameworks internally uses a SOAP stack for transport and format handling. Since XFire is a SOAP stack capable of easily building web services, let us look into one sample doing that here.
Our aim here is to expose a POJO as web service using XFire—org.codehaus.xfire.transport.http.XFireConfigurableServlet
.
XFireConfigurableServlet expects a service definition in the form of an xml file called services.xml
. XFire by itself is a web-based application; hence we are going to package the sample application as a standard web archive.
We will now look at the contents of the individual artifacts that make up the web archive:
public interface IHello { String sayHello(String name); }
2. HelloServiceImpl.class:
HelloServiceImpl
...