Web Services
  Home arrow Web Services arrow Page 4 - Fault Handling with Web Services
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

Fault Handling with Web Services
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 4
    2006-08-31

    Table of Contents:
  • Fault Handling with Web Services
  • Fault Handling
  • Fault Handler Example
  • Event Handling

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Fault Handling with Web Services - Event Handling


    (Page 4 of 4 )

    Event handlers can be associated with a scope or a process for concurrent processing of events. BPEL defines two types of events:

    • Message event—Implements a request-response or one-way operation invoked by a business partner

    • Alarm event—Implements timer-driven behavior

    When a scope is active, then event handlers attached to the scope are enabled to receive concurrent messages or alarm events. They are disabled when the processing of the scope ends. Events can only be processed when the corresponding event handler is enabled. When the event handlers for a scope become disabled, running event handlers are allowed to complete. The scope is terminated when all event handlers have completed processing.

    During the processing of message events, the event handler remains enabled. Therefore, it can concurrently process multiple events of the same type. In addition to flow activities, this is the second place in BPEL where concurrency is possible. Note that event handlers for a process can't create new process instances.

    If an alarm event handler is specified with a duration, then this duration starts when the event handler for the scope is enabled.

    In the following example, an event handler is defined that allows a partner to end the lifecycle of the process instance:

    <eventHandlers>
    <onMessage partnerLink="buyer" 
    portType="purchaseOrderPortType" 
    operation="cancelPurchaseOrderRequest" 
    variable="purchaseOrderCancellation">
    <correlations>
    <correlation set="orderCorrelationSet"
    initiate="no"/> </correlations> <terminate/> </onMessage> <onAlarm> ... </onAlarm> </eventHandlers>

    If a buyer chooses to cancel a previously submitted purchase order, the cancellation request is processed by a concurrent event handler. The correct process instance is located using the correlation set definition introduced earlier. In this sample, the event handler is implemented by a terminate activity, which causes the activities on all parallel branches of the process to stop immediately.

    Please check back next week for the conclusion of this article.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Building Web Services with Java: Making...
     

    Buy this book now. This article is excerpted from chapter 12 of Building Web Services with Java: Making Sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 0672326418). Check it out today at your favorite bookstore. Buy this book now.

    WEB SERVICES ARTICLES

    - Safety, Idempotence, and the Resource-Orient...
    - The Resource-Oriented Architecture in Action
    - Features of the Resource-Oriented Architectu...
    - The Resource-Oriented Architecture
    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek