9
INFSO-RI-508833 Enabling Grids for E- sciencE www.eu-egee.org Developing a JAX-RPC based service from wsdl document in a web service environment Author E.Slabospitskaya Location IHEP, Protvino, Russia

Developing a JAX-RPC based service from wsdl document in a web service environment

Embed Size (px)

DESCRIPTION

Author E.Slabospitskaya Location IHEP, Protvino, Russia. Developing a JAX-RPC based service from wsdl document in a web service environment. Necessary Tools. 1) Sun Java -2 Software Development Kit Standard Edition J2sdk-1.4. 2_04 2) Tomcat 5.0 etc - PowerPoint PPT Presentation

Citation preview

Page 1: Developing a JAX-RPC based  service from wsdl document in a web service environment

INFSO-RI-508833

Enabling Grids for E-sciencE

www.eu-egee.org

Developing a JAX-RPC based service from

wsdl document in a web service environment

Author E.SlabospitskayaLocation IHEP, Protvino, Russia

Page 2: Developing a JAX-RPC based  service from wsdl document in a web service environment

2

Enabling Grids for E-sciencE

INFSO-RI-508833

Necessary Tools

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.

Page 3: Developing a JAX-RPC based  service from wsdl document in a web service environment

3

Enabling Grids for E-sciencE

INFSO-RI-508833

Files’ Location

http:Tutorial’ materialshttp://w3.ihep.su/egee/NA3_course.shtml

- config.xml- BNQuoteService.wsdl- bnclient.java

- jwsdp.sh - webservices_readme.txt

List of Java WS Developer Pack APIhttp://java.sun.com/webservices/docs/1.1/api/index.htmlList of Java WS Developer Pack API

http://l

Page 4: Developing a JAX-RPC based  service from wsdl document in a web service environment

4

Enabling Grids for E-sciencE

INFSO-RI-508833

Use JAX-RPC to create a web service

Page 5: Developing a JAX-RPC based  service from wsdl document in a web service environment

5

Enabling Grids for E-sciencE

INFSO-RI-508833

Stubs and ties

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.

Page 6: Developing a JAX-RPC based  service from wsdl document in a web service environment

6

Enabling Grids for E-sciencE

INFSO-RI-508833

detailed description of what 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.

Page 7: Developing a JAX-RPC based  service from wsdl document in a web service environment

7

Enabling Grids for E-sciencE

INFSO-RI-508833

Who provides the layers

Layer Source

HelloClient Program

HelloWorld Service (definition interface and implementation class)

Provided by the application developer

Stubs Generated by the wscompile tool, which is run by the application developer

Ties Generated by the wsdeploy tool, which is run by the application developer

JAX-RPC Runtime

System

Included with the Java WSDP

Page 8: Developing a JAX-RPC based  service from wsdl document in a web service environment

8

Enabling Grids for E-sciencE

INFSO-RI-508833

Useful Commands for example

• wscompile.sh -gen:client keep –d . Config.xml

• javac bnclient.java

• java bnclient

Page 9: Developing a JAX-RPC based  service from wsdl document in a web service environment

9

Enabling Grids for E-sciencE

INFSO-RI-508833

List of libraries

• 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