Application Platform 10.3 | Application Platform API | Invoking IS Services in Web Applications | Invoking IS Services from JSP Pages
 
Invoking IS Services from JSP Pages
You can configure your Tomcat instance to control when JSP pages are compiled into Java classes. When you develop JSP pages, you can configure them to invoke IS services using:
*A webMethods tag library for JSP.
For information about the webMethods JSP tag library, see webMethods Tag Library Summary.
*Direct service invocation using the IS service API.
For information about the IS service API, see the Integration Server Java API Reference.
Direct Service Invocation
You can invoke IS services by using the com.wm.app.b2b.server.Service.doInvoke(), provided by Integration Server, in a JSP page scriptlet block.
Important:
If you have migrated a web application from the WmTomcat package to the WmAppPlat package, you must implement an additional logic to all JSP pages to ensure that the executing thread contains a valid state before it invokes any IS services. This is required, since the Tomcat connectors now receive requests through the WmAppPlat package, instead of an HTTP dispatch handler. Software AG recommends that you use the <webm:invoke> custom tag and implement the following logic:
import com.wm.app.b2b.server.*;
import javax.servlet.*;

try{
// --- this additional code must be added to ensure the invoke state exists
for the executing thread.
InvokeState invokeState = InvokeState.getCurrentState();
if ( invokeState == null) {
InvokeState.setCurrentState(InvokeState.create( ));
}
// ---
IData idata = Service.doInvoke( "pub.string", "concat", idata );

}catch( Throwable t){
throw new ServletException(t);
}