Professional Documents
Culture Documents
as a Web Service
Jaliya Ekanayake
Agenda
► Few Definitions
► The Basics of Web Services
► Benefits of Web Services
► Simple Web Service Example
► What is available in J2EE Technology
► EJB Web Services
► Exposing an EJB as a Web Service
► Tools Support
► Best Practices
► Sample Scenario
Web Services - Basics
► Definitions
Web service is a software application identified by a URI [RFC 2396],
whose interfaces and bindings are capable of being defined, described,
and discovered as XML artifacts. A Web service supports direct interactions
with other software agents using XML based messages exchanged via
Internet-based protocols. – W3C
Web services--software components that are programmatically accessible
over standard Internet protocols – Java Blue Prints
► SOAP Handler
Takes the parameters from the native client address space and transform (serialize)
then to SOAP.
Takes the SOAP from the network and transform (de-serialize) it to parameters of
the native service address space.
SOAP Handler may accept SOAP messages sent on various transport protocols.
► E.g. HTTP, SMTP, TCP etc..
► HTTP is the most popular protocol
Benefits of Web Services
SOAP Service
Over HTTP SOAP
Handler
Servlet Container
JAX-RPC Service Endpoint with SOAP Over HTTP
J2EE Architecture
► J2EE 1.4 Allows JAX-RPC (JSR 101) Web Services using Stateless Session
Beans.
► JAX-RPC hides the complexity of SOAP messages from the developer.
► J2EE web services can be invoked by any web service client, and any J2EE
web service client can invoke any web service.
Exposing an Stateless EJB as a Web Service
► Simple Steps
Define the service interface (Depending on the business functionality that needs to be exposed)
>>
Generate the WSDL for the above service end point >>
► E.g. Using Java2WSDL from Apache
► Demo
► Accessing the web service can be done by J2EE, J2SE, J2ME or any other clients that are
running on different platforms.
Tools Support
► Servers that support JSR109
Sun Java™ System Application Server Platform Edition 8.1
JBOSS-4.0.1RC1
Oracle Application Server Containers for J2EE (OC4J) 10.0.3
Sun ONE (Open Network Environment) Application Server
IBM Websphere V6
Weblogic Server 7.0
Apache Geronimo
► JBOSS Documentation
http://docs.jboss.org/jbossas/getting_started/startguide40/ws.html
► Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML
Technologies
http://java.sun.com/blueprints/guidelines/designing_webservices/
► Web Services for J2EE, Version 1.0 (JSR109)
ftp://www-126.ibm.com/pub/jsr109/spec/1.0/websvcs-1_0-fr.pdf
► Tutorial for building J2EE Applications using JBOSS and ECLIPSE
http://www.tusc.com.au/tutorial/html/chap1.html
► http://www.javaworld.com/javaworld/jw-08-2004/jw-0802-ejbws.html
► http://publib.boulder.ibm.com/infocenter/iadthelp/index.jsp?topic=/com.ibm.etools.webs
ervice.doc/concepts/cjsr109.html
► http://dev2dev.bea.com/products/wlserver/articles/Gilbode.jsp
► http://incubator.apache.org/projects/geronimo/
► http://java.sun.com/developer/technicalArticles/J2EE/j2ee_ws/#design
Thank You
CardValidator Web Service (JSE)
<<
CardValidator Client (JSE)
<<
Web service endpoint for the stateless EJB
<<
ejb-jar.xml
<<