Databases Reference
In-Depth Information
Asynchronous service
Following our StockQuote service, another service would be a stock order service,
which would enable us to buy or sell a particular stock. For this service, a client
would need to specify the stock, whether they wanted to buy or sell, the quantity,
and the price.
It makes sense to make this an asynchronous service, as once the order has
been placed, it may take seconds, minutes, hours, or even days for the order to
be matched.
Now, I'm not aware of any trade services that are free to try (probably for a good
reason!). However, there is no reason why we can't simulate one. To do this,
we will write a simple asynchronous process.
Drag another BPEL process on to our StockService composite and give it the name
StockOrder , but specify that it is an asynchronous BPEL process.
As with the StockQuote process, we also want to specify predefined elements for
its input and output. The elements we are going to use are placeOrder for the input
and placeOrderResponse for the output, the definitions for which are shown in the
following code snippet:
<xsd:elementname="placeOrder"type="tPlaceOrder"/>
<xsd:elementname="placeOrderResponse"type="tPlaceOrderResponse"/>
<xsd:complexTypename="tPlaceOrder">
<xsd:sequence>
<xsd:elementname="currency"type="xsd:string"/>
<xsd:elementname="stockSymbol"type="xsd:string"/>
<xsd:elementname="buySell"type="xsd:string"/>
<xsd:elementname="quantity"type="xsd:integer"/>
<xsd:elementname="bidPrice"type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexTypename="tPlaceOrderResponse">
<xsd:sequence>
 
Search WWH ::




Custom Search