To Create a JSP file that Calls a Business Process Using the JPD Proxy
<%@ page import="com.bea.wli.bpm.proxy.JpdProxy"%> <%@ page import="com.bea.wli.bpm.proxy.JpdProxySession"%>
To learn about using the JpdProxySession interface, see To Import the Proxy Classes.
Using the same example as we used in How Do I: Use a JPD Proxy From a Java Client?, the code should resemble the following code:
try
{
PoProcess p = (PoProcess)
JpdProxy.create(
PoProcess.class,
PoProcess.SERVICE_URI,
new JpdProxy.ContextHandler()
{
public Context getContext() throws NamingException
{
Environment env = new Environment();
env.setProviderUrl("t3://localhost:7001");
env.setSecurityPrincipal("weblogic");
env.setSecurityCredentials("weblogic");
return env.getInitialContext();
}
});
PoDocument document = PoDocument.Factory.newInstance();
Po po = document.addNewPo();
po.setSku("abc");
PoReferenceDocument ref = p.processPO(document);
p.done();
}
catch (Exception e) { ... }
}
%>
</html>
Note: To learn about the signatures of the JpdProxy.create() class, see To Use the Proxy Factory (JpdProxy.create()) Method.
How Do I: Get a JPD Proxy for a Business Process?
How Do I: Use a JPD Proxy From a Java Client?
|
|