Section 10.1. Web Services Architecture


10.1. Web Services Architecture

Figure 10-1 shows how the VBAD client uses Web Services to access the JAW Motors inventory.

Figure 10-1. Web Service invocation


VBAD's web site acts as an external client that invokes the JAW Motors findAvailableCars( ) Web Service to get information about all JAW Motors cars. Underneath the covers, the client uses a Web Service proxy object to marshal the method findAvailableCars( ) call as a Simple Object Access Protocol (SOAP) Request and sends it to the JBoss application server. The SOAP Servlet picks up the SOAP Request, looks up the findAvailableCars service in the Web Services Definition Language (WSDL) file and invokes the findAvailableCars( ) method on behalf of the client. The findAvailableCars( ) method finds all unsold cars in the JAW Motors database, packages them into CarDTO objects, and returns control to the SOAP Servlet. The SOAP Servlet then marshals the CarDTO objects into a SOAP Response and returns it to the caller. On the client side, the Web Service proxy object unmarshals the SOAP Response into CarDTO objects to be displayed on the VBAD web site.

Web Services has its own terminology, so let's wade through the alphabet soup:


SOAP

SOAP is an XML-based, platform-neutral, wire protocol that enables remote communication. Client and server communicate using SOAP Messages that contain a Header and a Body. The Header has routing information and the Body holds the request/response data.


WSDL

WSDL is an XML-based interface descriptor that describes a web service interface along with its parameters. WSDL registers your Web Service with your server in the same way web.xml registers Servlets and ejb-jar.xml registers EJBs.


Web Service Proxy

A Web Service Proxy is a set of objects that work together to encapsulate low-level SOAP communication details and invokes a Web Service on behalf of a client. The client just uses the Web Service proxy and is oblivious to the low-level network API. SOAP toolkits are available for most programming languages that use the WSDL (for the Web Service) to generate Web Service proxy code for that language.


SOAP Servlet

As of J2EE 1.4, most application servers use a Servlet to listen for SOAP Requests, route them to a Web Service, and return the result(s) as a SOAP Response.



JBoss at Work. A Practical Guide
JBoss at Work: A Practical Guide
ISBN: 0596007345
EAN: 2147483647
Year: 2004
Pages: 197

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net