Enabling Grids for E-sciencE
Developing a JAX-RPC based service from wsdl document in a web service environment Author E.Slabospitskaya Location IHEP, Protvino, Russia
www.eu-egee.org
Necessary Tools Enabling Grids for E-sciencE
1) Sun Java -2 Software Development Kit Standard Edition J2sdk-1.4. 2_04 2) Tomcat 5.0 etc 3) jwsdp-1. 5 (Java Web Services Developer Pack) 4) Jwsdp 1.5 tutorial -? JAX-RPC for XML-based RPC is Java API for developing and using Web-Services. This is a collection of procedures that can be called by a remote client over the Internet. JAX-RPC based on SOAP. JAX-RPC defines runtime environment for creating and executing XML-based remote procedure calls.
2
Files’ Location Enabling Grids for E-sciencE
Tutorial’ materials
http: http://w3.ihep.su/egee/NA3_course.shtml - config.xml - BNQuoteService.wsdl - bnclient.java - jwsdp.sh - webservices_readme.txt
List of Java WS Developer Pack API http://java.sun.com/webservices/docs/1.1/api/index.html List of Java WS Developer Pack API http://
l
3
Use JAX-RPC to create a web service Enabling Grids for E-sciencE
4
Stubs and ties Enabling Grids for E-sciencE
Another important use for a WSDL document is as a basis for creating stubs, the lowlevel classes that are needed by a client to communicate with a remote service. In the JAX-RPC implementation, the tool that uses a WSDL document to generate stubs is called wscompile. The JAX-RPC implementation has another tool, called wsdeploy, that creates ties, the low-level classes that the server needs to communicate with a remote client. Stubs and ties, then, perform analogous functions, stubs on the client side and ties on the server side. And in addition to generating ties, wsdeploy can be used to create WSDL documents.
5
detailed description of what happens at runtime
Enabling Grids for E-sciencE
•
To call a remote procedure, the HelloClient program invokes a method on a stub, a local object that represents the remote service.
•
The stub invokes routines in the JAX-RPC runtime system.
•
The runtime system converts the remote method call into a SOAP message and then transmits the message as an HTTP request.
•
When the server receives the HTTP request, the JAX-RPC runtime system extracts the SOAP message from the request and translates it into a method call.
•
The JAX-RPC runtime system invokes the method on the tie object.
•
The tie object invokes the method on the implementation of the HelloWorld service.
•
The runtime system on the server converts the method's response into a SOAP message and then transmits the message back to the client as an HTTP response.
•
On the client, the JAX-RPC runtime system extracts the SOAP message from the HTTP response and then translates it into a method response for the HelloClient program. 6
Who provides the layers Enabling Grids for E-sciencE
Layer HelloClient Program HelloWorld Service (definition interface and Stubs implementation class) Ties JAX-RPC Runtime System
Source Provided by the application developer Generated by the wscompile tool, which is run by the application Generated by the developer wsdeploy tool, which is run by thewith application Included the Java developer WSDP 7
Useful Commands for example Enabling Grids for E-sciencE
• wscompile.sh -gen:client keep –d . Config.xml • javac bnclient.java • java bnclient
8
List of libraries Enabling Grids for E-sciencE
• CLASSPATH • • • • • • •
jwsdp-1.5/jaxrpc/lib/jaxrpc-api.jar: jwsdp-1.5/jaxrpc/lib/jaxrpc-impl.jar: jwsdp-1.5/jwsdp-shared/lib/jaqname.jar: jwsdp-1.5/jwsdshared/lib/activation.jar: jwsdp-1.5/jwsdp-shared/lib/mail.jar: jwsdp-1.5/saaj/lib/saaj-impl.jar:
jwsdp1.5/jaxp/lib/endorsed/xercesImpl.jar: • jwsdp-1.5/jaxp/lib/endorsed/dom.jar
9