Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Effectively Using Business-Tier Systems

Web services are usually built on existing business-tier systems. To effectively interface with these systems, you have to take into consideration the communication, frequency of interaction, and degree of exposure to the business components. For example, a purchase order web service must effectively interface with the underlying ERP systems.

Facilitating Asynchronous Communication

Web services can be designed to be synchronous or asynchronous in nature. In synchronous mode, a web service implements a call-and-response RPC mode of interaction. Here, when the service is invoked, the business logic behind the web service executes the logic while the client is waiting for a response. For example, this can be used in getting price quotes and stock quotes.

For complex processes such as orders and order changes, processing might take minutes or even days to complete. This is particularly true when the web service implementation depends on batch processing or manual steps that require human intervention. This is an asynchronous web service. The client does not wait for the response to do the next steps. It either checks back periodically to see if the process is completed on the web service producer side, or acts as a listener to any updates.

Web services standards include the infrastructure and mechanisms on which asynchronous operations can be based. Handling web services interactions asynchronously is useful to accommodate user interactions, legacy IT systems, and partner IT systems. In these instances, systems must not block one another, and relevant systems and data must be easy to connect. This is also essential for scalability.

To effectively build composite, asynchronous applications, Workshop provides a model for web service conversations. A conversation is a series of message exchanges in both directions that are related and share some context. The Workshop framework automatically manages a unique ID for each conversation, and messages in a conversation are related through a conversation ID. In addition, any class member variables are automatically persisted and available later as the conversation continues. To use conversations in Workshop, methods must be annotated as starting, continuing, or finishing a conversation. To start a conversation, you can use the following tag:

* @jws:operation
* @jws:conversation phase="start"

SOAP conversation is a SOAP- and WSDL-based specification that defines long-running and asynchronous interactions between SOAP-based senders and receivers.Workshop web service conversations enable you to easily build asynchronous web services without having to write the underlying infrastructure typically associated with these types of applications (see Figure 5.4).

Figure 5.4Figure 5.4 Asynchronous web service

Using a Coarsely Grained Approach

Much of the design of a web service interface involves designing the service's operations. After you determine the service's operations, you define the parameters for these operations, their return values, and any errors or exceptions that they can generate. That is, you define the method signatures of the service.

You should define the web service's interface for optimal granularity of its operations. Although finely grained service operations, such as an operation to browse a catalog by categories, products, or items, offer greater flexibility to the client, they also result in greater network overhead and reduced performance. More coarsely grained service operations, such as returning catalog entries in a set of categories, reduce network overhead and improve performance, although they are less flexible. Generally, you should consolidate finely grained operations into more coarsely grained ones to minimize expensive remote method calls. The key benefits of coarsely grained web services are that they provide a uniform interface, reduce coupling, increase manageability and reusability, centralize security management and transaction control, and improve performance.

With WebLogic Workshop, the XML documents that you exchange are business-level documents, such as entire invoices or purchase orders. The coarsely grained web services can access finely grained business logic through the control framework of WebLogic Workshop. You can have web services, such as purchase orders, that access finely grained controls for business logic such as EJB controls and database controls.

Exposing Business Logic Components

The Model-View-Controller (MVC) architecture is one of the well-known architecture frameworks used in many web-based applications. The MVC design is modular, separating the key components of the architecture:

  • Model—Contains data required by the application

  • View—Manages the presentation of the data to the user

  • Controller—Acts as an intermediary between the client and the data

The MVC approach (see Figure 5.5) can allow an organization to expose multiple interfaces to the same set of data. For example, consider a web service in which EJBs provide the data from a database (Model), JSPs are used to present the data (View), and servlets mange the interface between the client and the data (Controller). Now, if the client device changes from a browser to a PDA, the View can be changed from HTML to WML without affecting the EJBs and servlets. Also, if web services can be considered as just another View on the model, a web services presentation can easily be plugged into an existing MVC architecture. In this case, instead of HTML or WML being sent back to the client application, the web services View would construct XML or SOAP messages through interactions by interacting with the Controller.

Figure 5.5Figure 5.5 MVC architecture

A Java class or an EJB can perform the business logic for fulfilling a web service request. The EJBs that support web services are session- and message-driven beans. Stateless session beans facilitate RPC-style web services that result in component operation invocations. Message-driven beans facilitate document-oriented web services. They do asynchronous messaging through a JMS consumer. Java classes can also be used for the business logic and are simpler to implement.

WebLogic Workshop has a Controls Framework with many built-in controls, such as database, EJB, and web service, that can wrap the back-end components and help expose them as web services. We talk more about the Controls Framework in Chapter 8, "Using Controls, Bindings, and Parsers."

The Web Flow Framework is a visual representation of presentation scenarios in WebLogic Workshop. The web flow framework is based on Struts, which is based on the MVC design paradigm. WebLogic Workshop facilitates the Web Flow Framework, which extends the Struts framework to provide a simplified development model with numerous additional features.

Companies such as HP are using frameworks such as SSA, which is described in the accompanying sidebar to build well-designed robust, scalable, and extensible web services. SSA complements standard J2EE web service toolkits such as WebLogic Workshop and helps HP IT in creating a consistent, repeatable approach to developing web services in J2EE.

Shared Services Architecture

The Shared Services Architecture (SSA) is a framework based on J2EE standards that was developed at HP to meet developers' needs for reusable services. The first version of the SSA was released in the year 2000, and support for creating web services was added in 2002. The SSA was developed by and is maintained by a small team within HP IT; it is the corporate standard framework for all internal Java-based web services development.

As we have discussed in this chapter, there is more to programming of web services, in production, you need modular, reusable, high-performance web services. This is where the SSA framework codifies the use of best practices, including design patterns, into a ready-to-use architecture and offers a robust, flexible framework for implementing enterprise-class web services.

The SSA offers developers a set of higher-level abstractions such as Request, Result, Feature, and Business Policy that developers can start with instead of having to start with a clean slate for every new service that they implement.

The SSA offers help in several areas:

  • Designing and developing a layered service implementation

  • Developing a modular, reliable, scalable, high-performance service

  • Designing and developing a modular, easily repurposable user experience implementation

  • Enforcing business rules in an easy-to-change fashion

  • Dealing with error handling and metrics gathering

  • Providing scalability and availability, ERP/legacy integration, authentication, and authorization

  • Specifying and controlling the overall flow and calling service components at predefined points in time using predefined interfaces. Conceptually, this is very similar to what other frameworks such as Struts offer for building web UIs in Java.

The SSA architecture complements the frameworks, describes the overall structure of a shared service, and provides a design blueprint for organizing a service, including the logical layers that a service is recommended to have, and the responsibilities of those layers.

As complements of the core SSA framework itself, there are several plug-ins, utilities, and tools. The plug-ins expand the base functionality available in SSA and are analogous to web browser plug-ins. The list of available plug-ins includes the Apache Axis and the WebLogic SOAP plug-in for exposing SSA services as web services with different web services toolkits. The utilities include APIs for logging, metrics gathering, and lifecycle management. The tools include development tools such as code-generation wizards and deployment tools such as scripts and Ant build files.

Several key business benefits are associated with using SSA, including faster time to market, reduced total cost of ownership (TCO), reduced support costs, improved developer productivity, and improved capability to react to change. The SSA framework presently is being used in HP's identity-management solution for external users, HP Passport. It allows all external users to HP to be registered through web services built with the SSA framework in the BEA WebLogic plug-in. The SSA framework has helped make this solution robust and scaleable. It has high performance and is very flexible in adding operations to the existing web services.

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020