Home arrow Web Services arrow Page 2 - Web Services Reengineering: Finishing Touches
WEB SERVICES

Web Services Reengineering: Finishing Touches


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).

Author Info:
By: Sams Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 7
September 07, 2006
TABLE OF CONTENTS:
  1. · Web Services Reengineering: Finishing Touches
  2. · Listing 12.8 The Complete SkatesTown Business Process
  3. · Advanced Considerations
  4. · Summary

print this article
SEARCH DEVARTICLES

Web Services Reengineering: Finishing Touches - Listing 12.8 The Complete SkatesTown Business Process
(Page 2 of 4 )

<?xml version="1.0" encoding="UTF-8"?>
<process name="purchaseOrderProcess" 
targetNamespace="http://www.skatestown.com/
processes/purchaseOrderProcess" 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:plt="http://www.skatestown.com/processes/
poSubmissionPLT" xmlns:ppa="http://www.skatestown.com/processes/
poSubmissionPPA" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/ws/2003/03/
business-process/"> <!-- PartnerLink definitions --> <partnerLinks> <partnerLink name="buyer" partnerLinkType=
"plt:purchaseOrderPartnerLinkType" myRole="seller"/> <partnerLink name="local"
partnerLinkType="plt:localPartnerLinkType" partnerRole="sellerLocal"/> <partnerLink name="supplier" partnerLinkType=
"plt:orderSuppliesPartnerLinkType" myRole="seller" partnerRole="supplier"/> </partnerLinks> <!-- Partner definitions --> <partners> <partner name="skatestownCustomer"> <partnerLink name="buyer"/> </partner> <partner name="skatestown"> <partnerLink name="local"/> </partner> <partner name="skatestownSupplier"> <partnerLink name="supplier"/> </partner> </partners> <!-- Variable definitions --> <variables> <variable name="poSubmissionRequest" messageType="pos:poSubmissionRequest"/> <variable name="poSubmissionResponse" messageType="pos:poSubmissionResponse"/> <variable name="poSubmissionFaultInvalidPO" messageType=
"pos:poSubmissionFaultInvalidPO"/> <variable name="poSubmissionFaultOutOfStock" messageType=
"pos:poSubmissionFaultOutOfStock"/> <variable name="cancelPurchaseOrderRequest" messageType=
"pos:cancelPurchaseOrderRequest"/> <variable name="validatePurchaseOrderResponse" messageType=
"skt:validatePurchaseOrderResponse"/> <variable name="checkLocalStockResponse" messageType="skt:checkLocalStockResponse"/> <variable name="orderSuppliesRequest" messageType="sup:orderSuppliesRequest"/> <variable name="orderSuppliesResponse" messageType="sup:orderSuppliesResponse"/> <variable name="orderSuppliesFault" messageType="sup:orderSuppliesFault"/> </variables> <!-- Correlation set definitions --> <correlationSets> <correlationSet name="orderCorrelationSet" properties="ppa:customerID
ppa:orderNumber"/> </correlationSets> <!-- Fault handler definitions --> <faultHandlers> <catch faultName="pos:invalidPO"> <sequence> <assign> <copy> <from variable="poSubmissionRequest" part="purchaseOrder"
query="/billTo/id"/> <to variable=
"poSubmissionFaultInvalidPO" part="customerID"/> </copy> <copy> <from variable="poSubmissionRequest" part="purchaseOrder" query="/id"/> <to
variable="poSubmissionFaultInvalidPO" part="orderNumber"/> </copy> </assign> <reply partnerLink="buyer"
portType="pos:poSubmissionPortType" operation="poSubmission" faultName="pos:invalidPO" variable="poSubmissionFaultInvalidPO"> <correlations> <correlation set="orderCorrelationSet"
initiate="no"/> </correlations> </reply> </sequence> </catch> <catch faultName="pos:outOfStock"> <sequence> <assign> <copy> <from variable="poSubmissionRequest" part="purchaseOrder"
query="/billTo/id"/> <to
variable="poSubmissionFaultInvalidPO" part="customerID"/> </copy> <copy> <from variable="poSubmissionRequest" part="purchaseOrder" query="/id"/> <to
variable="poSubmissionFaultInvalidPO" part="orderNumber"/> </copy> </assign> <reply partnerLink="buyer"
portType="pos:poSubmissionPortType" operation="poSubmission" faultName="pos:outOfStock" variable="poSubmissionFaultOutOfStock"> <correlations> <correlation set="orderCorrelationSet"
initiate="no"/> </correlations> </reply> </sequence> </catch> </faultHandlers> <!-- Event handler definitions --> <eventHandlers> <onMessage partnerLink="buyer"
portType="pos:poSubmissionPortType" operation="cancelPurchaseOrder" variable="cancelPurchaseOrderRequest"> <correlations> <correlation set="orderCorrelationSet"
initiate="no"/> </correlations> <terminate/> </onMessage> </eventHandlers> <!-- Activity definitions --> <sequence> <receive partnerLink="buyer"
portType="pos:poSubmissionPortType" operation="poSubmission"
createInstance="yes" variable="poSubmissionRequest"> <correlations> <correlation set="orderCorrelationSet"
initiate="yes"/> </correlations> </receive> <flow> <links> <link name="validPurchaseOrder"/> <link name="invalidPurchaseOrder"/> <link name="inLocalStock_initiateDelivery"/> <link name="inLocalStock_createInvoice"/> <link name="notInLocalStock"/> <link
name="stockReplenished_initiateDelivery"/> <link
name="stockReplenished_createInvoice"/> </links> <invoke partnerLink="local"
portType="skt:skatestownPortType" operation="validatePurchaseOrder" inputVariable="poSubmissionRequest" outputVariable=
"validatePurchaseOrderResponse"> <source linkName="validPurchaseOrder" transitionCondition=
"bpws:getVariableData( 'validatePurchaseOrderResponse',
'valid')=true"/> <source linkName="invalidPurchaseOrder" transitionCondition=
"bpws:getVariableData( 'validatePurchaseOrderResponse',
'valid')=false"/> </invoke> <throw faultName="pos:invalidPO"> <target linkName="invalidPurchaseOrder"/> </throw> <invoke partnerLink="local"
portType="skt:skatestownPortType" operation="checkLocalStock" inputVariable="poSubmissionRequest" outputVariable="checkLocalStockResponse"> <target linkName="validPurchaseOrder"/> <source linkName=
"inLocalStock_initiateDelivery" transitionCondition=
"bpws:getVariableData( 'checkLocalStockResponse','available')
=true"/> <source
linkName="inLocalStock_createInvoice" transitionCondition=
"bpws:getVariableData( 'checkLocalStockResponse','available')
=true"/> <source linkName="notInLocalStock" transitionCondition=
"bpws:getVariableData( 'checkLocalStockResponse','available')
=false"/> </invoke> <sequence name="replenishStock"> <target linkName="notInLocalStock"/> <source
linkName="stockReplenished_initiateDelivery"/> <source
linkName="stockReplenished_createInvoice"/> <assign> <copy> <from variable="poSubmissionRequest" part="purchaseOrder"/> <to variable="orderSuppliesRequest" part="orderSupplies"/> </copy> <copy> <from partnerLink="supplier"
endpointReference="myRole"/> <to variable="orderSuppliesRequest" part="endpointReferenceOfSeller"/> </copy> </assign> <while condition="bpws:getVariableData( 'checkLocalStockResponse','available')=
false"> <sequence> <invoke partnerLink="supplier" portType=
"sup:orderSuppliesPortType" operation="orderSupplies" inputVariable=
"orderSuppliesRequest"> <correlations> <correlation
set="orderCorrelationSet" initiate="no"/> </correlations> </invoke> <pick> <onMessage partnerLink="supplier" portType=
"sup:orderSuppliesCallbackPortType" operation="orderSuppliesOk"
createInstance="no" variable=
"orderSuppliesResponse"> <correlations> <correlation
set="orderCorrelationSet" initiate="no"/> </correlations> <empty/> </onMessage> <onMessage partnerLink="supplier" portType=
"sup:orderSuppliesCallbackPortType" operation="orderSuppliesFailed" createInstance="no" variable="orderSuppliesFault"> <correlations> <correlation
set="orderCorrelationSet" initiate="no"/> </correlations> <throw faultName="pos:outOfStock"/> </onMessage> <onAlarm for="P1M"> <throw faultName="pos:outOfStock"/> </onAlarm> </pick> <invoke partnerLink="local" portType="skt:skatestownPortType" operation="checkLocalStock" inputVariable="poSubmissionRequest" outputVariable=
"checkLocalStockResponse"/> </sequence> </while> </sequence> <invoke partnerLink="local"
portType="skt:skatestownPortType" operation="initiateDelivery" inputVariable="poSubmissionRequest"> <target linkName=
"inLocalStock_initiateDelivery"/> <target
linkName="stockReplenished_initiateDelivery"/> </invoke> <invoke partnerLink="local"
portType="skt:skatestownPortType" operation="createInvoice" inputVariable="poSubmissionRequest" outputVariable="poSubmissionResponse"> <target
linkName="inLocalStock_createInvoice"/> <target
linkName="stockReplenished_createInvoice"/> </invoke> </flow> <reply partnerLink="buyer"
portType="pos:poSubmissionPortType" operation="poSubmission" variable="poSubmissionResponse"> <correlations> <correlation set="orderCorrelationSet"
initiate="no"/> </correlations> </reply>
</sequence> </process>

 


blog comments powered by Disqus
WEB SERVICES ARTICLES

- Dealing with Loose Coupling in a Service-Ori...
- Loose Coupling in a Service-Oriented Archite...
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials