Main BLOGGER
Google
WWW THIS BLOG
Friday, March 10, 2006
 
J2EE-Compatible Web Service creation and deployment
These are the basic steps for creating the web service and client: ()

1. Code the SEI (service endpoint interface) and implementation class and
interface configu
ration file(config-interface.xml, see step 3).

* It extends the java.rmi.Remote interface.
* It must not have constant declarations, such as public final static.
* The methods must throw the java.rmi.RemoteException or one of its subclasses. (The methods may also throw service-specific exceptions.)
* Method parameters and return types must be supported JAX-RPC types (see Types Supported by JAX-RPC).

2. Compile the SEI and implementation class.

3. Use wscompile to generate the files required to deploy the service.
config-interface.xml will specify
* service name
*WSDL target and type namespace
*SEI name,
*package Name where wscompile puts all the service classes into.

4. Use deploytool to package the files into a WAR file. (Assembling and Deploying Web Modules)
a. deployment descriptor ( Java Servlet Specification, v2.3, Chapter 13, Deployment Descriptors)
*
standard J2EE web.xml deployment descriptor for defining a Web Application
· ServletContext Init Parameters
· Session Configuration
· Servlet / JSP Definitions
· Servlet / JSP Mappings
· Application Lifecyle Listener classes
· Filter Definitions and Filter Mappings
· Mime Type Mappings
· Welcome File list
· Error Pages
· Security
* container specific deployment descriptor: sun-web.xml or weblogic.xml
b. webservice configuration xml (http://www.nabh.com/doc/sb_ws_config_ref_manual.html)
for example, jaxrpc-ri.xml
· General Settings - This section specifies framework object classes and parameters such as the request processor, server ID, user manager class, etc.
· Web Services - Specifies Web services to be loaded and their properties.
· Interceptors - Specifies interceptors to be loaded.
· Service-Interceptor Mapping - Mapping specifying the chain of interceptors invoked for a Web service invocation.

5. Deploy the WAR file. The tie classes (which are used to communicate with clients) are generated by the Application Server during deployment.

6. Code the client class and WSDL configuration file.

7. Use wscompile to generate and compile the stub files.

8. Compile the client class.


9. Run the client.



<< Home

Powered by Blogger

Google
WWW THIS BLOG