Professional Documents
Culture Documents
Jax RPC Example Lspitsky
Jax RPC Example Lspitsky
Author E.Slabospitskaya
Location IHEP, Protvino, Russia
www.eu-egee.org
Necessary Tools
Enabling Grids for E-sciencE
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
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 low-
level 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
Enabling Grids for E-sciencE happens at runtime
• 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 Source
Provided by the
HelloWorld Service application developer
(definition interface and
Stubs
implementation class) Generated by the
wscompile tool, which is
Ties run by the application
Generated by the
developer
wsdeploy tool, which is
JAX-RPC Runtime run by thewith
Included application
the Java
developer
WSDP
System
7
Useful Commands for example
Enabling Grids for E-sciencE
• 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