Book Image

Service Oriented Java Business Integration

Book Image

Service Oriented Java Business Integration

Overview of this book

Table of Contents (23 chapters)
Service Oriented Java Business Integration
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

Web Service Using XFireConfigurableServlet


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.

Sample Scenario

Our aim here is to expose a POJO as web service using XFire—org.codehaus.xfire.transport.http.XFireConfigurableServlet.

Code Listing

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:

  1. 1. IHello.class: IHello is a simple Java interface, declaring a single method sayHello.

    This is shown in the following code:

public interface IHello
{
String sayHello(String name);
}
  1. 2. HelloServiceImpl.class: HelloServiceImpl...