Modified: webservices/kandula/site/1/ws-ba--how_to_use.html URL: http://svn.apache.org/viewvc/webservices/kandula/site/1/ws-ba--how_to_use.html?rev=599146&r1=599145&r2=599146&view=diff ============================================================================== --- webservices/kandula/site/1/ws-ba--how_to_use.html (original) +++ webservices/kandula/site/1/ws-ba--how_to_use.html Wed Nov 28 13:02:06 2007 @@ -1,10 +1,9 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>WS-BusinessActivity for Kandula_1 How-To - Kandula-1</title><style type="text/css" media="all"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Kandula-1 - WS-BusinessActivity for Kandula_1 How-To</title><style type="text/css" media="all"> @import url("./style/maven-base.css"); - @import url("./style/maven-theme.css");</style><link rel="stylesheet" href="./style/print.css" type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta><meta name="author" content="Hannes Erven and Georg Hicker"></meta><meta name="email"></meta></head><body class="composite"><div id="banner"><a href="http://ws.apache.org/" id="organizationLogo"><img alt="Apache Web Services" src="http://ws.apache.org/images/project-logo.jpg"></img></a><a href="http://ws.apache.org/kandula/" id="projectLogo"><span>Apache Kandula</span></a><div class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft">Last published: 18 June 2007 - <span class="separator">|</span> Doc for 0.2-SNAPSHOT - </div><div class="xright"></div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuKandula-1"><h5>Kandula-1</h5><ul><li class="none"><a href="ws-at--how_to_use.html">WS-AT How-To</a></li><li class="none"><a href="ws-ba--how_to_use.html">WS-BA How-To</a></li><li class="none"><a href="publications.html">Publications</a></li></ul></div><div id="menuProject_Documentation"><h5>Project Documentation</h5><ul><li class="none"><a href="index.html">About</a></li><li class="collapsed"><a href="project-info.html">Project Info</a></li><li class="collapsed"><a href="maven-reports.html">Project Reports</a></li><li class="none"><a href="http://maven.apache.org/development-process.html" class="externalLink" title="External Link">Development Process</a></li></ul></div><div id="legend"><h5>Legend</h5><ul><li class="externalLink">External Link</li><li class="newWindow">Opens in a new window</li></ul></div><a href="http://maven.apache.or g/" title="Built by Maven" id="poweredBy"><img alt="Built by Maven" src="./images/logos/maven-button-1.png"></img></a></div></div><div id="bodyColumn"><div class="contentBox"><div class="section"><a name="Business_Activity_basics"></a><h2>Business Activity basics</h2> - <p align="justify">A WS-BA Business Activity is a coordination context with relaxed constraints compared to + @import url("./style/maven-theme.css");</style><link rel="stylesheet" href="./style/print.css" type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta><meta name="author" content="Hannes Erven and Georg Hicker"></meta><meta name="email"></meta></head><body class="composite"><div id="banner"><a href="http://ws.apache.org/" id="organizationLogo"><img alt="Apache Web Services" src="http://ws.apache.org/images/project-logo.jpg"></img></a><a href="http://ws.apache.org/kandula/" id="projectLogo"><span>Apache Kandula</span></a><div class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft"> + Last published: 28 November 2007 + | Doc for 0.2-SNAPSHOT</div><div class="xright"></div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuKandula-1"><h5>Kandula-1</h5><ul><li class="none"><a href="ws-at--how_to_use.html">WS-AT How-To</a></li><li class="none"><a href="ws-ba--how_to_use.html">WS-BA How-To</a></li><li class="none"><a href="publications.html">Publications</a></li></ul></div><div id="menuProject_Documentation"><h5>Project Documentation</h5><ul><li class="none"><a href="index.html">About Apache Kandula</a></li><li class="collapsed"><a href="project-info.html">Project Info</a></li><li class="collapsed"><a href="maven-reports.html">Project Reports</a></li><li class="none"><a href="http://maven.apache.org/development-process.html" class="externalLink" title="External Link">Development Process</a></li></ul></div><a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy"><img alt="Built by Maven" src="./images/logos/maven-butto n-1.png"></img></a></div></div><div id="bodyColumn"><div class="contentBox"><div class="section"><a name="Business_Activity_basics"></a><h2>Business Activity basics</h2><p align="justify">A WS-BA Business Activity is a coordination context with relaxed constraints compared to WS-AT Atomic Transaction. The most important differences are: <ul> <li><b>Atomicity:</b> the work done in the context need not appear to be atomic to the outside, e.g. intermediate results @@ -18,14 +17,9 @@ is told to cancel, other participants may complete and close their work. </li> </ul> - </p> - </div><div class="section"><a name="Step_1:_Adopting_the_Web_Service_Interface_Definition__WSDL_"></a><h2>Step 1: Adopting the Web Service Interface Definition (WSDL)</h2> - - <p align="justify">When a web service client invites a business partner into a WS-Coordination transaction, they send them + </p></div><div class="section"><a name="Step_1:_Adopting_the_Web_Service_Interface_Definition__WSDL_"></a><h2>Step 1: Adopting the Web Service Interface Definition (WSDL)</h2><p align="justify">When a web service client invites a business partner into a WS-Coordination transaction, they send them a WS-Coordination coordination context object that includes the address of the coordination service, the transaction's identifier - and other data the coordination service requires.</p> - - <p align="justify">The web service provider needs to allow a WS-Coordination Coordination Context object to be included with the + and other data the coordination service requires.</p><p align="justify">The web service provider needs to allow a WS-Coordination Coordination Context object to be included with the business request: <blockquote><code><pre> <wsdl:definitions @@ -50,16 +44,13 @@ </wsdl:types> </pre></code></blockquote> - </p> - </div><div class="section"><a name="Step_2:_Implementing_the_Service"></a><h2>Step 2: Implementing the Service</h2> - <p align="justify"> + </p></div><div class="section"><a name="Step_2:_Implementing_the_Service"></a><h2>Step 2: Implementing the Service</h2><p align="justify"> A WS-BA enabled web service needs to do only two things: <ul> <li>After receiving a CoordinationContext from the client, register yourself in the transaction.</li> <li>When receiving commands from the Coordinator, do your business and report back.</li> </ul> - </p> - <p align="justify"> + </p><p align="justify"> Apache Kandula provides two classes for registering participants with a coordination context: <ul> <li><b>org.apache.kandula.coordinator.ba.participant.BAwPCParticipant</b>, @@ -75,103 +66,57 @@ is reported by returning a corresponding value. </li> </ul> - </p> - <p align="justify"> + </p><p align="justify"> Your participant implementation needs to extend one of those classes and implement the abstract methods. Thats it! - </p> - - <div class="subsection"><a name="Implementing_the_abstract_methods_of_the_participant_classes"></a><h3>Implementing the abstract methods of the participant classes</h3> - <p align="justify">The following sections document what your implementation of kandula's abstract methods is required to do.</p> - </div> - - <div class="subsection"><a name="onComplete"></a><h3>onComplete</h3> - <p align="justify">This method is only applicable for the Coordination Completion participant. When it is invoked, the + </p><div class="subsection"><a name="Implementing_the_abstract_methods_of_the_participant_classes"></a><h3>Implementing the abstract methods of the participant classes</h3><p align="justify">The following sections document what your implementation of kandula's abstract methods is required to do.</p></div><div class="subsection"><a name="onComplete"></a><h3>onComplete</h3><p align="justify">This method is only applicable for the Coordination Completion participant. When it is invoked, the coordinator tells you to actually perform the requested work.<br></br> Return <code>ParticipantCompleteResult.COMPLETED</code> when you were able to complete your work as requested, or <code>ParticipantCompleteResult.HANDLED_BY_APPLICATION</code> if you like not to report something back at the moment. You need to call one of the <code>tell...()</code> methods to send your response to the coordinator at any time you wish. - </p> - </div> - - <div class="subsection"><a name="onCancel"></a><h3>onCancel</h3> - <p align="justify">When the coordinator sends Cancel, it asks you to cancel all outstanding work. If you were able + </p></div><div class="subsection"><a name="onCancel"></a><h3>onCancel</h3><p align="justify">When the coordinator sends Cancel, it asks you to cancel all outstanding work. If you were able to successfully abort and cancel everything, return <code>ParticipantCancelResult.CANCELED</code>. After the coordinator acknowledges the receipt of Canceled, the participant is no longer needed. - </p> - <p align="justify">If the service is unable to cancel, it should have reported Completed before.</p> - </div> - - <div class="subsection"><a name="onClose"></a><h3>onClose</h3> - <p align="justify"> + </p><p align="justify">If the service is unable to cancel, it should have reported Completed before.</p></div><div class="subsection"><a name="onClose"></a><h3>onClose</h3><p align="justify"> After having reported Completed, either from <code>onComplete</code> or by having invoked <code>tellCompleted()</code>, the business partner decided to go for it. Perform whatever it takes to finalize your work and return <code>ParticipantCloseResult.CLOSED</code> when done. - </p> - <p align="justify">Please note that the service may not report any fault at this stage! You must successfully complete!</p> - </div> - - <div class="subsection"><a name="onCompensate"></a><h3>onCompensate</h3> - <p align="justify"> + </p><p align="justify">Please note that the service may not report any fault at this stage! You must successfully complete!</p></div><div class="subsection"><a name="onCompensate"></a><h3>onCompensate</h3><p align="justify"> After having reported Completed, either from <code>onComplete</code> or by having invoked <code>tellCompleted()</code>, the business partner decided to throw away your work. Perform whatever it takes to compensate previous actions and return <code>ParticipantCompensateResult.COMPENSATED</code> when done. - </p> - <p align="justify">If compensation is not possible, you need to return <code>ParticipantCompensateResult.FAULTED</code> + </p><p align="justify">If compensation is not possible, you need to return <code>ParticipantCompensateResult.FAULTED</code> and humans must investigate the issue. This should almost never happen. - </p> - </div> - - <div class="subsection"><a name="onFinish"></a><h3>onFinish</h3> - <p align="justify"> + </p></div><div class="subsection"><a name="onFinish"></a><h3>onFinish</h3><p align="justify"> The coordinator informs you that the result of your work, whatever it is, was acknowledged and that you may forget about the transaction. This means the participant object may now be destroyed. - </p> - </div> - </div><div class="section"><a name="Step_3:_Implementing_the_Client"></a><h2>Step 3: Implementing the Client</h2> - <p align="justify"> - </p> - </div><div class="section"><a name="Step_4:_Adding_business_logic_to_the_client"></a><h2>Step 4: Adding business logic to the client</h2> - <p align="justify"> - </p> - </div><div class="section"><a name="Step_5:_Deploying_and_Testing"></a><h2>Step 5: Deploying and Testing</h2> - <p align="justify"> - </p> - </div><div class="section"><a name="Running_the_samples"></a><h2>Running the samples</h2> - <p align="justify"> + </p></div></div><div class="section"><a name="Step_3:_Implementing_the_Client"></a><h2>Step 3: Implementing the Client</h2><p align="justify"> + </p></div><div class="section"><a name="Step_4:_Adding_business_logic_to_the_client"></a><h2>Step 4: Adding business logic to the client</h2><p align="justify"> + </p></div><div class="section"><a name="Step_5:_Deploying_and_Testing"></a><h2>Step 5: Deploying and Testing</h2><p align="justify"> + </p></div><div class="section"><a name="Running_the_samples"></a><h2>Running the samples</h2><p align="justify"> To try out the samples provided with Kandula-1, you need the following prerequisites: <ul> <li>Apache Tomcat with Apache Axis installed</li> <li>Kandula Sources from SVN checked out</li> </ul> - </p> - <p align="justify"> + </p><p align="justify"> The WS-BA examples require you to have two Tomcat Servers running, one acting as the coordination service and one as the participants. The initiator will run independently as JUnit test cases or a Swing application. - </p> - - <div class="subsection"><a name="Building"></a><h3>Building</h3> - <p align="justify"> + </p><div class="subsection"><a name="Building"></a><h3>Building</h3><p align="justify"> Build Kandula as usual with "maven". Build the BusinessActivity-Testsuite and the Holiday example by running "ant" in the "samples/holiday" or "samples/ba-testsuite" directories. - </p> - <p align="justify"> + </p><p align="justify"> Copy the jar-files from the respective "build" directories into the axis/lib folders of your Axis installation. - </p> - </div> - <div class="subsection"><a name="Preparing_the_Tomcats"></a><h3>Preparing the Tomcats</h3> - <p align="justify"> + </p></div><div class="subsection"><a name="Preparing_the_Tomcats"></a><h3>Preparing the Tomcats</h3><p align="justify"> If you run Kandula from an IDE such as eclipse, you can typically manage multiple configurations there. The Eclipse Web Tools Projects, for example, offers to set different "base" directories with different axis installations. - </p> - <p align="justify"> + </p><p align="justify"> The easiest way to have two Tomcat instances running is to copy the whole "Tomcat"-directory. This tutorial will refer to the "Coordination Server" and to the "Participant Server". - </p> - <p align="justify"> + </p><p align="justify"> First, we configure the Coordination Server. It does not require the two JAR files from holiday and ba-testsuite. Copy the "src/conf/server-only-config_with_WSBA.wsdd" to the axis/WEB-INF folder and rename it to "server-config.wsdd". If the file already exists, replace it with that one. @@ -190,13 +135,11 @@ and be fully qualified. It is used to generate the endpoint addresses that is sent to the peers. The kandula.preferredCoordinationService property tells Kandula at which coordination service it shall create new coordination contexts; at the coordinator, this should point to itself. - </p> - <p> + </p><p> The Coordination Server is now ready!<br></br> Start it up by invoking the Tomcat/bin/startup script and verify that the Axis List Services page shows the "coordinator", "kandula_BA_PC_coordinator" and some more services named like that. - </p> - <p align="justify"> + </p><p align="justify"> Second, we configure the Participant Service. This server requires the Kandula, ba-testsuite and holiday jar files in its axis/web-inf/lib directory. Copy the "server-participant-only-with-test-config_with_WSBA.wsdd" from the src/conf directory to the axis/WEB-INF folder and @@ -217,41 +160,31 @@ The kandula.preferredCoordinationService property tells Kandula at which coordination service it shall create new coordination contexts. - </p> - <p> + </p><p> The Participant Server is now ready!<br></br> Start it up by invoking the Tomcat/bin/startup script and verify that the Axis List Services page shows the "participant", "kandula_BA_PC_participant" and some more services named like that. - </p> - <p align="justify"> + </p><p align="justify"> Start up now the TCP Port Monitor, if you chose to use it. - </p> - </div> - <div class="subsection"><a name="Run_"></a><h3>Run!</h3> - <p align="justify"> + </p></div><div class="subsection"><a name="Run_"></a><h3>Run!</h3><p align="justify"> After having started both servers, the port monitor if configured and verifying everything is OK, start the holiday demo by issuing "ant run" in the holiday folder. - </p> - <p align="justify"> + </p><p align="justify"> The holiday example consists of two rental providers that offer cars and rooms for rent. When starting up the client, you must first chose whether you'd like atomic or mixed outcome. - </p> - <p align="justify"> + </p><p align="justify"> Select "car" or "room" from the dropdown and hit the "Search for offers" button. The client now fetches offers from the remote web service on the participant web server. You may search for multiple different offers, also cars and rooms mixed. Choose some of the offers from the list, and hit the "add selected offer to basket" button to put the offer into the basket. The client now contacts the remote web service again, but this time provides the CoordinationContext to enrol a participant. The Rental Web Service immediatly enroles for the transaction. - </p> - <p align="justify"> + </p><p align="justify"> To check the state of the business activity, switch to the "basket" tab and hit the "refresh basket" button. Depending on mixed or atomic outcome, the available buttons at the bottom change. With mixed outcome, select one or more participants from the basket and hit the "complete", "close", etc. buttons to send the corresponding messages to the participants. Refresh will always refresh the participant list. If you press buttons to send messages that are not applicable in the current state of the context or participant, there is no error message but the command is silently ignored. - </p> - </div> - </div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2007, Apache Web Services</div><div class="clear"><hr></hr></div></div></body></html> \ No newline at end of file + </p></div></div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2007, Apache Web Services</div><div class="clear"><hr></hr></div></div></body></html> \ No newline at end of file
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
