Overview
This article will help you migrate Web services applications developed for JBoss v4 to Apache Geronimo. This article is part of a series of migration articles covering different types of applications migration.
This article provides some details on the differences between these two application servers as well as a detailed step-by-step migration procedure for porting Web services applications from JBoss v4 to Apache Geronimo v1 (milestone build M5). To define a common starting point (the source environment) we provide steps for deploying the sample Search a Phone Directory Web services application into the JBoss source environment. Then you will be guided through the application migration and deployment process onto Apache Geronimo.
This article is organized in the following sections:
- Web Services implementation analysis
- Sample application
- The JBoss environment
- The Geronimo environment
- Step-by-step migration
- Summary
Web Services implementation analysis
Web services implementation may vary from one vendor to another. The purpose of this section is to provide comparison of JBoss and Apache Geronimo features which are used in the implementation of the sample application described further in this article. You can use the information below to identify the differences of these two servers and plan for migration accordingly.
Features |
JBoss v4 |
Geronimo |
---|---|---|
Web services engine |
Currently uses Apache Axis. However, JBoss plans to implement its own engine in the near future. |
Uses Apache Axis. |
Document/literal Web services |
Runs server and Web client endpoints generated according to Java Web services specification. |
Runs server and Web client endpoints generated according to Java Web services specification. However, it requires that an element defined in the XML schema and representing request message of an operation has exactly the same name as the operation. |
The described Geronimo requirement for names of request elements and operations is be illustrated by the following example where names which must be the same are marked with bold:
The following example illustrates the requirement from Geronimo of having the same name the request elements. Look for the three occurences of myOperation".
<wsdl:definitions targetNamespace="http://myService.com/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://myService.com/service" xmlns:types="http://myService.com/service/types"> <wsdl:types> <xsd:schema targetNamespace="http://myService.com/service/types"> <xsd:element name="myOperation">...</xsd:element> <xsd:element name="myOperationResponse">...</xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="myOperationRequest"> <wsdl:part element="types:myOperation" name="parameters"/> </wsdl:message> <wsdl:message name="myOperationResponse"> <wsdl:part element="types:myOperationResponse" name="result"/> </wsdl:message> <wsdl:portType name="myServicePortType"> <wsdl:operation name="myOperation"> <wsdl:input message="tns:myOperationRequest" name="myOperationRequest"/> <wsdl:output message="tns:myOperationResponse" name="myOperationResponse"/> </wsdl:operation> </wsdl:portType> ... </wsdl:definitions>
Sample application
This article contains the Search a Phone Directory Web services application to demonstrate Web services migration from JBoss to Geronimo. The application implements both server and Web-client sides of a simple service which searches through a phone directory. The user works with the Web-client to test the application. The user specifies a search criterion and receives the search results.
Download the Search a Phone Directory Web services application from the following URL:
http://opensource2.atlassian.com/confluence/oss/download/attachments/1141/webservices.zip
After extracting the ZIP file, a webservices directory is created, from now on this directory will be referred as <webservices_home>.
The Web service is generic in implementation and is based on the document/literal encoding style. The WSDL document describing the service can be found in the directory <webservices_home>/web/WEB-INF/wsdl.
Application classes and JSP pages
The sample application consists of the following packages, the source code can be found in the <webservices_home>/src directory.
- com.ibm.j2g.webservices.server - Implementation of the server endpoint of the Web service:
- SearchPhonesServer classes - Implements business logic of the service.
- PersonPhone, Search, SearchPhonesPortType and SearchResponse classes - Generated from the WSDL document by Java Web Services Development Pack.
- com.ibm.j2g.webservices.client - Implementation of the client endpoint of the Web service:
- PersonPhone, Search, SearchPhonesPortType, SearchPhonesService and SearchResponse classes - Generated from the WSDL document.
In addition to these packages, the client endpoint of the Web service also consists a single JSP page. This JSP displays a search form, sends request to the server endpoint and displays the search results.