Professional Documents
Culture Documents
This document gives the step by step process for developing, deploying and testing of a
simple Webservice in RAD 6.0 IDE.
1) Bottom Up or Stub scenario : create a Web service from a Java bean or a EJB or a
DADX.
2) Top Down or Skeleton scenario : create a Web service from a Web Service
Description Language (WSDL) file
Depending upon the server and the chosen run-time, the artifacts that the Web services
wizard generates may vary. The end result is a deployed Web service on a server.
If a vendor deploys a Web service and you would like to create a client to use it, the
Web service client wizard does this by starting with the WSDL file.
A Web service can be based on a number of different types including a Java bean,
Enterprise Java Bean (EJB) component, DADX document, and so on..
We can start at different points in the wizard and create a Web service using different file
types. One start point is with a Java Bean. The Web services wizard would then generate
the Requestor-side files including the proxy bean, the WSDL file, and Provider-side files.
This is known as the Bottom Up scenario
We can also start with a WSDL file and generate the Requestor-side artifacts and the
Provider artifacts including a skeleton bean with the WSDL operations. The
implementation is left to you to fill in. This is known as the Skeleton or Top Down
Scenario.
When deploying a Web service, your choice of run-time and server affects both the
chosen J2EE specification level, as well as the files generated. WebSphere Application
Server V6.0 supports the J2EE 1.4 specification. The concept of Web projects being
deployed to an EAR file exists for WebSphere Application Server. Web services
information for J2EE is stored in a file called webservices.xml.
If we are creating a webservice in Bottom Up scenario,In this case several file types
have been generated including deserializer, serializer, and helper files. These files
are used to convert the incoming XML message to Java language and outgoing Java
language to XML. There is also a SEI file which holds all the operations in the Web
service. The client proxy is generated using this file. A WSDL file is generated into the
Web Content directory. This contains information about the Web service that has just
been deployed to the server. The WSDL Test Clients use the WSDL file to test the
service directly. Rational Application Developer provides the Web service Explorer which
you can use to test the service.
Deploy the service to the EAR and deploy the EAR to the server
Deploying the Web services using the Web services wizard. A number of files are
generated to facilitate the serialization and deserialization of the messages to and from
the service. Information is also added to the webservices.xml, web.xml, and
x_mapping.xml. This information describes the deployment of the service. This follows
the J2EE 1.4 standard. At this point all the information about the Web service has been
deployed to the EAR. The EAR has then been added to WebSphere Application Server.
To generate a client, select the checkbox next to the corresponding label that says
generate proxy on the first page of the Web services wizard. Another way to generate a
client is to start with a WSDL from the service. This is known as the Client scenario .In
this case it is assumed the service has already been deployed. The Web services wizard
creates a Web project called MyWSProjectClient and a new EAR file that contains this
project. Again there are serializer, deserializer, and helper classes. The key file that the
test facilities focus on is the proxy file.
Example of HelloWorld Web Service using Bottom-up approach
Go to File->NewOther
Select Dynamic Web Project
Click Next, then enter the name of the Dynamic Web Project
Click Next
Click Finish and click Yes to open in J2EE perspective otherwise select No to open in
java perspective.
Now we can see two folders created in Package Exoplorer view,namely
Click Next and browse HelloWorld.java file from that particular package structure
Click Next
Click Next
Click Next
Click Next
Click Next
Some jsps are also created which can be used for testing the webservice.