Flow or Java Service to acces outside the IS

Hi,

my requirment is that i have to use JSP and java services to invoke the IS services.

I have imported jars of IS server in eclipse to invoke the IS services by use of java service and then i will poplated to JSP pages.
when i run the Java service in eclipse it throw error.

For undestading purpose i created a simple Flow service(Test) with input field “Name” and output field “OutputName” which is map directly.

This IS service is in package Sample:Test

in eclipse i create the java servive to invoke the flow service as.

import java.util.;
import com.wm.data.
;
import com.wm.util.Values;
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;

public class webMethodsClass {

public void methodsTest()
{

         String value ="Reema";
        IData input = IDataFactory.create();
        IDataCursor inputCursors = input.getCursor();
        IDataUtil.put( inputCursors, "input", value);
     IData outputs = null;
    
    try
        {
        outputs = Service.doInvoke("Sample","Test",input);
        }
            catch (Exception e)
                {
                e.printStackTrace();
                }

IDataCursor outputCursor = outputs.getCursor();
//String value = IDataUtil.getString(outputCursor,OutputName);
outputCursor.destroy();
System.out.println(“OUTPUT IS:” +value);
}
}

please guide me on this part.how we can access the flow or java service outside the IS.

Regards
Reema

Might I suggest invoking the IS service using just HTTP and not using the IS API? The wM documentation describes how to call IS services from external Java programs.

Hi Reema,
You have to use Context object, means log into the IS and using that content can invoke the IS services.

  1. Use com.wm.app.b2b.client.Context and use connect() method to login.
  2. Then using invoke() method you can invoke the services by providing the inputs.
    Go though the documentation for more clarity. (As Rob suggested, throw some light on why http invocation doesn’t fit).

Cheers
Guna

Hi Reema,

Use the following code to login to the IS first then you can execute other commands in your code.

Context ctx=new Context();
ctx.connect(“servername:port”,“Username”,“password”);

cheers

Thanks to the others for indicating how to make using the IS Java API work–but might I again recommend that you not do it this way?

Posting an XML doc over HTTP, or passing parms on the URL over HTTP, or posting a form over HTTP are non-proprietary ways to invoke IS services. They don’t require putting wM IS libraries on the JVM box and the code will be familiar to most Java programmers whereas using the IS Java API, while not difficult, will be completely foreign to most.

Just something to consider.