Application Integration (On-Premises) : Incorporating web applications : webMethods Tag Library for JSP : <webm:invoke>
<webm:invoke>
You use the <webm:invoke> tag to call an Integration Server service. You can also define a block of code to execute if the service completes without errors and a block of code to execute 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 execute if the service completes without errors. Use the <webm:onError> tag to define the block of code to execute if the service fails. Within the <webm:onError> tag block of code, you can use these pipeline variables:
Key
Description
errorClass
Exception name.
errorMessage
Error message text.
localizedMessage
Localized error message text that uses the client’s locale.
errorService
Service that failed.
errorInputs
Inputs to the service that failed.
errorOutputs
Outputs of the service that failed. Could 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
This code calls 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. If the service fails, error information is displayed.
<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>
Copyright © 2015- 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback