Leveraging Architecture Adapters in the Case Study


The P.T. Monday Coffee Company application uses architecture adapters only when interfacing with Web Services. Further, Axis generates the architecture adapters, and they have no impact on developers in terms of coding responsibilities. On the other hand, the build environment is definitely more complex with the extra generation steps. Direct usage of architecture adapters occurs in three places:

  • When service behaviors require interactions with external Web Services

  • When you expose service behaviors as Web Services

  • When service behaviors must interact with the service directory to publish or locate a service

In the case of interacting with the service directory, you use an off-the-shelf package, UDDI4J, to interact with the service directory. The client-side class library handles service interactions. It is likely that developers built much of the client-side access library with a tool similar to the Apache Axis WSDL2Java tool.

Generation of the architecture adapters that connect SOAP messages to the service behaviors occurs upon deployment of a service through the administration facilities of Apache Axis, as discussed in this chapter and the previous chapter. Generation of the architecture adapters from WSDL files, for your service behaviors to access outside Web Services, occurs using the WSDL4Java tool at build time for your application.

Identifying Important Classes and Files in the Case Study

Table 4-1 shows the primary code discussed in this chapter that you should browse in the downloaded source code.

Table 4-1: Sample Location

FILE

LOCATION

DESCRIPTION

CustomerCollectionImpl.java

src\com\servicefoundry\books\ webservices \entities

The primary Java class that becomes a Web Service by using the Apache Axis deployment mechanisms. This class uses JDO as a persistence mechanism.

CustomerImpl.java

src\com\servicefoundry\books\webservices\entities

A class whose object instances represent customers in your application. In this chapter, the customer implementation is not aWeb Service; however, the customer collection implementation does serialize instances of customers to your client application.

CustomerInformationImpl.java

src\com\servicefoundry\books\webservices\entities

Additional information about customers, such as credit card numbers . Like the customer, this class is not a Web Service, though the customer collection ends up returning instances of the customer information indirectly through the customer instances.

TestCustomerCollection WebService

src\com\servicefoundry\books\webservices\tests

A client-side test program that uses the client-side architecture adapter to access the customer collection Web Service.

Using Ant Targets to Run the Case Study

Table 4-2 describes the targets to run for the ant environment to see the programs and chapter samples in operation. Before running any samples, be sure you read and perform all of the install steps in Appendix A.

Table 4-2: Ant Targets

TARGET

DESCRIPTION

testcustomercollectionwebservice

This runs the TestCustomerCollection WebService program. You must have deployed the Web Services according to the instructions in Appendix A.




Web Service Patterns
Web Services Patterns: Java Edition
ISBN: 1590590848
EAN: 2147483647
Year: 2003
Pages: 190

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