Application Platform 10.5 | Application Platform API | webMethods Tag Library for JSP | <webm:invoke>
 
<webm:invoke>
Use the <webm:invoke> tag to call an Integration Server service. You can also define a block of code to be executed if the service completes without errors and a block of code to be executed if the service fails. Integration Server runs the specified service at run time and returns the results of the service to the JSP.
Use the <webm:onSuccess> tag to define the block of code to be executed if the service completes without errors. Use the <webm:onError> tag to define the block of code to be executed if the service fails. You can use pipeline variables in the <webm:onError> tag. The following table lists the available pipeline variables:
Key
Description
errorClass
Exception name.
errorMessage
Error message text.
localizedMessage
Localized error message text that uses the locale of the customer.
errorService
Failed service.
errorInputs
Input for the failed service.
errorOutputs
Output for the failed service. Can be null.
Syntax
<webm:invoke serviceName="service">
<webm:onSuccess>block_of_code</webm:onSuccess>
<webm:onError>block_of_code</webm:onError>
</webm:invoke>
Arguments
Argument
Description
service
Fully qualified name of the service to call.
Example
To call the Integration Server service orders:getShipInfo, which gets shipping information from a back-end system and builds an HTML form that allows the user to edit or cancel an order and display error information if the service fails:
<webm:invoke serviceName="orders:getShipInfo">
<h2>Shipping Details for Order <webm:value variable="/oNum"/></h2>
<p>Date Shipped: <webm:value variable="shipDate"/><br>
Carrier: <webm:value variable="carrier"/>
<webm:value variable="serviceLevel"/></p>
<hr>
<webm:ifvar variable="shipDate" notempty="true">
<form action="http://rubicon:5555/orders/editShipInfo.dsp"
method="get">
<p><b>Change this Shipment:</b></p>
<p><input type="RADIO" name="action" value="edit">
Edit Shipment Details</p>
<p><input type="RADIO" name="action" value="cancel">
Cancel this shipment</p>
<input type="SUBMIT" value="Submit">
<input type="HIDDEN" name="oNum"
value="<webm:value variable=’/oNum’/>"
</form>
<hr>
</webm:ifvar>
<p><a href="http://rubicon:5555/orders/getorder.dsp
?action=showorder&oNum=<webm:value variable=’/oNum’/>View Entire Order</a></p>
<webm:onError>
<hr>
<p><font color="#FF0000">Integration Server could not process
your request because the following error occurred. Contact
your server administrator.</font></p>
<table width="50%" border="1">
<tr>
<td><b>Service</b></td>
<td><webm:value variable="errorService"/></td>
</tr>
<tr>
<td><b>Error</b></td>
<td><webm:value variable="errorMessage"/></td>
</tr>
</table>
<hr>
</webm:onError>
</webm:invoke>