Web Services
  Home arrow Web Services arrow Web Services Reengineering: Finishing Touc...
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

Web Services Reengineering: Finishing Touches
By: Sams Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2006-09-07

    Table of Contents:
  • Web Services Reengineering: Finishing Touches
  • Listing 12.8 The Complete SkatesTown Business Process
  • Advanced Considerations
  • Summary

  • 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


    Web Services Reengineering: Finishing Touches


    (Page 1 of 4 )

    In the previous five articles, we have reengineered the web services for a sample website and business. In this sixth and final part, we pull it all together. It 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).

    SkatesTown: Putting It All Together

    The Web services reengineering project at SkatesTown is now complete. The hard-coded Java implementation of the submitPurchaseOrder Web service has been replaced by a business process, and the external interface of the service has been extended accordingly.

    The purchase order BPEL process is a long-running process, and, as such, it represents a stateful Web service. The Web service interface for the purchase order submission now supports fault messages. An additional operation is provided to allow the buyer to cancel a running purchase order. In addition, the process interacts with a Web service provided by SkatesTown's supplier.

    Figure 12.7 gives an overview of the BPEL and WSDL artifacts of the SkatesTown business process. The interface of the SkatesTown process and its invoked services is provided by the three WSDL documents in Listings 12.3, 12.4, and 12.5. They show the Web service interfaces of the buyer, the seller, and the supplier, respectively.


    Figure 12.7  BPEL and WSDL artifacts for the SkatesTown business process

    Listing 12.3 PortType Offered to the Buyer

    <?xml version="1.0" ?>
    <definitions name="poSubmission" 
    targetNamespace="http://www.skatestown.com/
    services/interfaces/ poSubmission.wsdl" xmlns:pos="http://www.skatestown.com/
    services/interfaces/ poSubmission.wsdl" xmlns:po="http://www.skatestown.com/ns/po" xmlns:inv="http://www.skatestown.com/ns/invoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/
    wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Type definitions --> <types> <xsd:schema> <!-- rest of invoice schema definition from
    chapter 2 --> <xsd:import namespace=
    "http://www.skatestown.com/ns/invoice" schemaLocation="../../ns/invoice.xsd"/> <!-- rest of purchaseOrder schema definition
    from chapter 2 --> <xsd:import namespace=
    "http://www.skatestown.com/ns/po" schemaLocation="../../ns/po.xsd"/> </xsd:schema> </types> <!-- Message definitions --> <message name="poSubmissionRequest"> <part name="purchaseOrder" element="po:po"/> </message> <message name="poSubmissionResponse"> <part name="invoice" element="inv:invoice"/> </message> <message name="poSubmissionFaultInvalidPO"> <part name="customerID" element="xsd:ID"/> <part name="orderNumber"
    element="xsd:positiveInteger"/> </message> <message name="poSubmissionFaultOutOfStock"> <part name="customerID" element="xsd:ID"/> <part name="orderNumber"
    element="xsd:positiveInteger"/> </message> <message name="cancelPurchaseOrderRequest"> <part name="purchaseOrder" element="po:po"/> </message> <!-- Port type definitions --> <portType name="poSubmissionPortType"> <operation name="doSubmission"> <input message="pos:poSubmissionRequest"/> <output message="pos:poSubmissionResponse"/> <fault name="invalidPO"
    message="pos:poSubmissionFaultInvalidPO"/> <fault name="outOfStock"
    message="pos:poSubmissionFaultOutOfStock"/> </operation> <operation name="cancelPurchaseOrder"> <input message=
    "pos:cancelPurchaseOrderRequest"/> </operation> </portType> </definitions>

    Listing 12.4 PortType of SkatesTown's Local Services

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="skatesTown"
    targetNamespace="http://www.skatestown.com/
    services/interfaces/ skatesTown.wsdl" xmlns:skt="http://www.skatestown.com/
    services/interfaces/skatesTown.wsdl" xmlns:pos="http://www.skatestown.com/
    services/interfaces/poSubmission.wsdl" xmlns:po="http://www.skatestown.com/ns/po" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Type definitions --> <types> <xsd:schema> <!-- Imports (message definitions from
    external interface: submitPurchaseOrderRequest,
    submitPurchaseOrderResponse) --> <xsd:import
    namespace="http://www.skatestown.com/ns/po" schemaLocation="../../ns/po.xsd"/> </xsd:schema> </types> <!-- Message definitions --> <message name="validatePurchaseOrderResponse"> <part name="valid" element="xsd:boolean"/> </message> <message name="checkLocalStockResponse"> <part name="available" element="xsd:boolean"/> </message> <!-- Port type definitions --> <portType name="skatestownPortType"> <operation name="validatePurchaseOrder"> <input message="submitPurchaseOrderRequest"/> <output message=
    "validatePurchaseOrderResponse"/> </operation> <operation name="checkLocalStock"> <input message="submitPurchaseOrderRequest"/> <output message="checkLocalStockResponse"/> </operation> <operation name="initiateDelivery"> <input message="submitPurchaseOrderRequest"/> </operation> <operation name="createInvoice"> <input message="submitPurchaseOrderRequest"/> <output
    message="submitPurchaseOrderResponse"/> </operation> </portType> </definitions>

    Listing 12.5 PortTypes Offered and Used by the Supplier

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="orderSupplies"
    targetNamespace="http://www.wheelsandboards.com/
    services/interfaces/ orderSupplies.wsdl" xmlns:asp="http://www.wheelsandboards.com/
    services/interfaces/ orderSupplies.wsdl" xmlns:po="http://www.skatestown.com/ns/po" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/
    03/addressing" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Type definitions --> <types> <xsd:schema> <!-- Imports (message definitions from
    skatestown, ideally, should be shared between
    skatestown and wheelsandboards) --> <xsd:import
    namespace="http://www.skatestown.com/ns/po" schemaLocation=
    "http://www.skatestown.com/ns/po.xsd"/> </xsd:schema> </types> <!-- Message definitions --> <message name="orderSuppliesRequest"> <part name="orderSupplies" element="po:po"/> <part name="endpointReferenceOfSeller" element= "wsa:EndpointReferenceType"/> </message> <message name="orderSuppliesResponse"> <part name="customerID" element="xsd:ID"/> <part name="orderNumber"
    element="xsd:positiveInteger"/> </message> <message name="orderSuppliesFault"> <part name="customerID" element="xsd:ID"/> <part name="orderNumber"
    element="xsd:positiveInteger"/> </message> <!-- Port type definitions --> <portType name="orderSuppliesPortType"> <operation name="orderSupplies"> <input message="asp:orderSuppliesRequest"/> </operation> </portType> <portType name="orderSuppliesCallbackPortType"> <operation name="orderSuppliesOk"> <input message="asp:orderSuppliesResponse"/> </operation> <operation name="orderSuppliesFailed"> <input message="asp:orderSuppliesFault"/> </operation> </portType> </definitions>

    The SkatesTown business process refers to three partnerLinkTypes for the interactions with the buyer, the supplier, and its own internal services. These partnerLinkTypes are defined in the WSDL shown in Listing 12.6.

    Listing 12.6 SkatesTown PartnerLinkType Definitions

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="poSubmissionPLT"
    targetNamespace="http://www.skatestown.com/
    processes/poSubmissionPLT" xmlns:pos="http://www.skatestown.com/
    services/interfaces/poSubmission.wsdl" xmlns:skt="http://www.skatestown.com/
    services/interfaces/skatesTown.wsdl" xmlns:sup="http://www.wheelsandboards.com/
    services/interfaces/ orderSupplies.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/
    05/partner-link/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- PartnerLinkType definitions --> <plnk:partnerLinkType
    name="purchaseOrderPartnerLinkType"> <plnk:role name="seller"> <plnk:portType
    name="pos:poSubmissionPortType"/> </plnk:role> </plnk:partnerLinkType> <plnk:partnerLinkType name="localPartnerLinkType"> <plnk:role name="sellerLocal"> <plnk:portType name="skt:skatesTownPortType"/> </plnk:role> </plnk:partnerLinkType> <plnk:partnerLinkType
    name="orderSuppliesPartnerLinkType"> <plnk:role name="supplier"> <plnk:portType
    name="sup:orderSuppliesPortType"/> </plnk:role> <plnk:role name="seller"> <plnk:portType
    name="sup:orderSuppliesCallbackPortType"/> </plnk:role> </plnk:partnerLinkType> <!-- Port type definitions --> <import namespace="http://www.skatestown.com/
    services/interfaces/ poSubmission.wsdl" location="../services/interfaces/
    poSubmission12.wsdl"/> <import namespace="http://www.skatestown.com/
    services/interfaces/ skatesTown.wsdl" location="../services//interfaces/
    skatesTown.wsdl"/> <import namespace="http://www.wheelsandboards.com/
    services/interfaces/ orderSupplies.wsdl" location="http://www.wheelsandboards.com/
    services/interfaces/ orderSupplies.wsdl"/> </definitions>

    The correlation set defined as part of the SkatesTown business process names two properties. The WSDL snippet in Listing 12.7 shows the properties and their relationship to WSDL message types.

    Listing 12.7 SkatesTown Property and Property Alias Definitions

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="poSubmissionPPA"
    targetNamespace="http://www.skatestown.com/
    processes/poSubmissionPPA" xmlns:pos="http://www.skatestown.com/services/
    interfaces/poSubmission.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsbp="http://schemas.xmlsoap.org/ws/2003/
    03/business-process/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- Property and property alias definitions --> <wsbp:property name="customerID" type="xsd:ID"/> <wsbp:property name="orderNumber"
    type="xsd:positiveInteger"/> <wsbp:propertyAlias propertyName="customerID" messageType="pos:poSubmissionRequest" part="purchaseOrder"
    query="/billTo/id"/> <wsbp:propertyAlias propertyName="orderNumber" messageType="pos:poSubmissionRequest" part="purchaseOrder" query="/id"/> <wsbp:propertyAlias propertyName="customerID" messageType="pos:poSubmissionResponse" part="invoice" query="/billTo/id"/> <wsbp:propertyAlias propertyName="orderNumber" messageType="pos:poSubmissionResponse" part="invoice" query="/id"/> <wsbp:propertyAlias propertyName="customerID" messageType=
    "pos:poSubmissionFaultInvalidPO" part="customerID"/> <wsbp:propertyAlias propertyName="orderNumber" messageType=
    "pos:poSubmissionFaultInvalidPO" part="orderNumber"/> <wsbp:propertyAlias propertyName="customerID" messageType=
    "pos:poSubmissionFaultOutOfStock" part="customerID"/> <wsbp:propertyAlias propertyName="orderNumber" messageType=
    "pos:poSubmissionFaultOutOfStock" part="orderNumber"/> <wsbp:propertyAlias propertyName="customerID" messageType=
    "pos:cancelPurchaseOrderRequest" part="purchaseOrder"
    query="/billTo/id"/> <wsbp:propertyAlias propertyName="orderNumber" messageType=
    "pos:cancelPurchaseOrderRequest" part="purchaseOrder" query="/id"/> <!-- Port type definitions --> <import namespace="http://www.skatestown.com/
    services/interfaces/ poSubmission.wsdl" location="../services/interfaces/
    poSubmission12.wsdl"/> </definitions>

    Finally, the complete SkatesTown business process is shown in Listing 12.8.

    More Web Services Articles
    More By Sams Publishing


       · This article is an excerpt from the book "Building Web Services with Java: Making...
       · The old data processing phrase "garbage in, garbage out" has never implied that the...
     

    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 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek