Application Integration
- Application Integration
- All Products
package org.ActiveVOS.wsio.invoke; import org.ActiveVOS.wsio.IAeWebServiceResponse; public interface org.ActiveVOS.wsio.invoke.IAeInvokeHandler { /** * Handles the invoke call. Query data will be null if * none was specified on the customInvokerUri. * @param aInvoke * @param aQueryData */ public IAeWebServiceResponse handleInvoke (IAeInvoke aInvoke, String aQueryData); }
public IAeWebServiceResponse handleInvoke(IAeInvoke aInvoke, String aQueryData) { // Parse the query data section of the uri to create the // message type qname, // then create the appropriate response and return. Map data = parse( aQueryData ); Integer maxLoan = new Integer( (String)data.get(URI_PARM_MAXLOAN)); String ns = (String)data.get(URI_PARM_MSG_NAMESPACE); String lp = (String)data.get(URI_PARM_MSG_LOCALPART); QName messageType = new QName(ns, lp); // Get input message data. IAeWebServiceMessageData input = aInvoke.getInputMessageData(); Map input_data = input.getMessageData(); Integer amount = (Integer)input_data.get(MSG_AMOUNT); // Determine response. String approval = APPROVER_DENY_RESP; if ( validateLoan(amount, maxLoan) ) approval = APPROVER_ACCEPT_RESP; // Build and return response message. Note that in this example, // the implementation is for a request/response invocation. // For a request-only invocation, you would not need to // setMessageData. Map output_data = new HashMap(); output_data.put(MSG_ACCEPT, approval); AeWebServiceMessageData msgData = new AeWebServiceMessageData(messageType, output_data); AeInvokeResponse response = new AeInvokeResponse(); response.setMessageData( msgData ); return response; }