Here is the java code to wrap scheduled services in a context wrapper… The only way to avoid FTP session collision:
inputs:
server: your servername:port
ifc: interface name ie folder name
service: actual service to be run
Schedule this instead of the service…
// ------------Begin code---------------
Context user = new Context();
String server = new String();
String ifc = new String();
String service = new String();
String id = new String();
String pass = new String();
// pipeline in
IDataCursor pipelineCursor = pipeline.getCursor();
if ( pipelineCursor.first( “server” ) ) server = (String) pipelineCursor.getValue();
if ( pipelineCursor.first( “interface” ) ) ifc = (String) pipelineCursor.getValue();
if ( pipelineCursor.first( “service” ) ) service = (String) pipelineCursor.getValue();
if ( pipelineCursor.first( “id” ) ) id = (String) pipelineCursor.getValue();
if ( pipelineCursor.first( “password” ) ) pass = (String) pipelineCursor.getValue();
try {
user.connect(server, id, pass);
// pipeline out
pipelineCursor.last();
IData out = IDataFactory.create();
out = user.invoke(ifc, service, pipeline);
user.disconnect();
pipelineCursor.insertAfter( “out”, out );
pipelineCursor.destroy();
} catch (Exception e) {
Service.throwError(e);
}
// -----------End code-------------------
#Integration-Server-and-ESB#webMethods#webmethods-Protocol-and-Transport