<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> SCA invocation sample

SCA invocation sample





<%@ page import="commonj.sdo.*"%> <%@ page import="com.ibm.websphere.bo.*"%> <%@ page import="com.ibm.websphere.sca.ServiceManager"%> <%@ page import="com.ibm.websphere.sca.Service"%> <% String name = request.getParameter("name"); if (name == null) { %>

Parameter name not found.

<% } else { ServiceManager manager = new ServiceManager(); BOFactory factory = (BOFactory) manager.locateService("com/ibm/websphere/bo/BOFactory"); //BOType typeService = (BOType)manager.locateService("com/ibm/websphere/bo/BOType"); //Type partType = typeService.getTypeByElement("http://HelloSnippetProcess/HelloSnippetProcessInterface","sayHello"); //DataObject Input = factory.createByType(partType); DataObject Input = factory.createByElement( "http://SimpleProcessLibrary/bpc/samples/SimpleProcessInterface", "hello"); Input.createDataObject("input"); Input.getDataObject("input").setString("name", name); Service process = (Service) manager.locateService("SimpleProcessInterfacePartner"); DataObject Out = (DataObject) process.invoke("hello", Input); String resp = Out.getDataObject("output").getString("result"); try { out.println("

" + resp + "

"); } catch (Exception e) { e.printStackTrace(System.out); } } %>