IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Flow or Java Service to acces outside the IS

    Posted Sun May 03, 2009 10:43 AM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Flow or Java Service to acces outside the IS

    Posted Mon May 04, 2009 05:34 AM

    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.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Flow or Java Service to acces outside the IS

    Posted Mon May 04, 2009 04:11 PM

    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


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: Flow or Java Service to acces outside the IS

    Posted Tue May 05, 2009 12:58 PM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Flow or Java Service to acces outside the IS

    Posted Tue May 05, 2009 05:15 PM

    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.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB