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
Expand all | Collapse all

Invoking a COM object from webMethods

  • 1.  Invoking a COM object from webMethods

    Posted Mon December 09, 2002 09:13 PM

    Hi,
    I have a COM dll using which I have to access some methods.
    The vb code for the method is

    Dim mySearch As New XDOGCOMLib.Search 
    mySearch.SearchTable = "Products" 
    

    I want to use webMethods to access this method. I am successful in creating the Search Object using win32.COM.dispatch:createObject, but dont have a clue how to set the properties as in the “mySearch.SearchTable = Products” statements.
    Any ideas?
    Thanks in advance.
    VR


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


  • 2.  RE: Invoking a COM object from webMethods

    Posted Mon December 09, 2002 09:30 PM

    What webMethods product are you using? Both Enterprise Server and Integration Server provide facilities for accessing COM objects–but the solution for each is quite different.


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


  • 3.  RE: Invoking a COM object from webMethods

    Posted Mon December 09, 2002 09:36 PM

    Oh, I am using Integration Server 4.6 and Developer 4.6
    Thanks
    Vinod


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


  • 4.  RE: Invoking a COM object from webMethods

    Posted Mon December 09, 2002 09:53 PM

    Oops. I had skipped over the “win32.COM.dispatch:dispatch” reference which indicates IS. Sorry about that.

    Use win32.COM.dispatch:invoke

    pDispatch–the object created by win32.COM.dispatch:createObject
    dispName–“SearchTable”
    params–“Products” (you’ll need to create as a String List)

    HTH


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


  • 5.  RE: Invoking a COM object from webMethods

    Posted Mon December 09, 2002 10:29 PM

    Okay, That was really helpful. Now the real messy part. I am pasting the whole vb code here and against each task writing down what I did. Whenever I couldnt find an appropriate step in webMethods, I have placed a question mark. Please take a look and let me know what you think. Thanks

    '***************** A2i Catalog Connection ************************
    Dim a2i_Catalog As New XDOGCOMLib.Catalog - win32.COM.dispatch:createObject( progid =XDOGOMLib.Catalog context = INPROC server = server ip address)

    Call a2i_Catalog.Login(“10.10.10.10”, 9999, “username”, “password”) - win32.COM.dispatch:invoke (dispName = Login accessType = method params = (“10.10.10.10”, 9999, “username”, “password”) )
    '*****************************************************************

    Dim mySearch As New XdogCOMLib.Search - win32.COM.dispatch:createObject( progid =XdogCOMLib.Search context = INPROC server = server ip address) 
    
    mySearch.SearchTable = "Products" - ? 
    
    Dim fftp As XdogCOMLib.FreeFormTableParameter -win32.COM.dispatch:createObject( progid =XdogCOMLib.FreeFormTableParameter context = INPROC server = server ip address) 
    
    Set fftp = mySearch.Parameters.NewFreeFormParameter("Products") - ? 
    
    Dim ffpf As XdogCOMLib.FreeFormParameterField - win32.COM.dispatch:createObject( progid =XdogCOMLib.FreeFormParameterField context = INPROC server = server ip address) 
    
    Set ffpf = fftp.Fields.New("TIMSR ID") 
    ffpf.FreeForm.NewString "3MR8210" 
    
    Dim rsd As New XdogCOMLib.ResultSetDefinition win32.COM.dispatch:createObject( progid =XdogCOMLib.ResultSetDefinition context = INPROC server = server ip address) 
    rsd.Table = "Products"    - ? 
    rsd.Fields.Append "TIMS ID"   - ? 
    rsd.Fields.Append "Item Number"  - ? 
    rsd.Fields.Append "Manufacturer PN"  - ? 
    
    Dim rs As XdogCOMLib.ResultSet  win32.COM.dispatch:createObject( progid =XdogCOMLib.ResultSet context = INPROC server = server ip address) 
    
    Set rs = a2i_Catalog.GetResultSet(mySearch, rsd) - ? 
    
    rs.MoveFirst 
    

    MsgBox (rs.Fields(“TIMS ID”))
    MsgBox (rs.Fields(“Item Number”))

    End Sub


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


  • 6.  RE: Invoking a COM object from webMethods

    Posted Mon December 09, 2002 10:31 PM

    My question is how do we set the property for a particular object? I even reached the step

    Set rs = a2i_Catalog.GetResultSet(mySearch, rsd) - ?

    where it failed. My guess is since I have two webMethods objects in “mySearch” and “rsd” variables, I tried to substitute them in the params field, that might be causing the error.
    Thanks
    VR


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


  • 7.  RE: Invoking a COM object from webMethods

    Posted Tue December 10, 2002 02:27 PM

    Hello…
    Does someone knows how to do this? Help me please!
    :cry:
    VR


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


  • 8.  RE: Invoking a COM object from webMethods

    Posted Tue December 10, 2002 04:52 PM

    From the Developer Guide:

    To invoke methods or properties on this object once you have created it, use win32.COM.dispatch:invoke. You need to supply this service with the following inputs:

    Name Description
    pDispatch An object reference previously obtained by the call to createObject, or obtained in the result value of a previous call to invoke.

    dispName The name of the COM method or property that you want to invoke.

    accessType Optional. The type of operation (METHOD, GET, PUT, PUTREF) to be performed on dispName. If you are invoking a DCOM object, always set accessType to GET. Incorrect setting of this parameter will cause the invoke to fail. If you are unsure whether a dispName is a method or property, examine the component’s type library using OLEVIEW or a Microsoft development environment.

    params Optional. An object array of parameters. This is exposed in Developer as an array of Strings for usability (because Objects cannot be manipulated in Developer), but is in reality an Object array. If you need to pass complex or native types, you may have to create this value within your own service.

    [end]

    For the rsd object, you’ll need to call invoke multiple times, one for each parameter you want to set.

    Same thing for mySearch.

    Then make an object list with mySearch as element [0] and rsd as element [1]. Then call invoke on a2i_Catalog.


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


  • 9.  RE: Invoking a COM object from webMethods

    Posted Mon December 30, 2002 07:04 AM

    When i try to invoke a COM object using SAP BC I am getting a error message java.lang.NoClassDefFoundError?

    i just used InvokeLate and Invoke only not the CreateObject as described in SAP business connector PDF manual.For both i am getting the error.How to solve it?


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


  • 10.  RE: Invoking a COM object from webMethods

    Posted Thu August 28, 2003 05:52 AM

    Has anyone been able to use wM IS and Developer 4.6 to invoke a DCOM object. I tried the following simple example from Microsoft:

    [url=“http://support.microsoft.com/default.aspx?scid=kb”]Microsoft Support

    and was able to remotely invoke the DCOM object using the client, but could not simulate the returned results using wM Developer. I used a simple createObject and invoke flow services as described in the wM Developer User Guide but keeps getting the following:

    win32.COM.WmDispatchException:Invalid class string
    Error Code = 800401f3

    Any ideas?


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


  • 11.  RE: Invoking a COM object from webMethods

    Posted Wed July 06, 2005 03:40 PM

    Hi there,

    Currently, I’m facing some error while invoking a DCOM object through webMethods Integration Server 4.6.

    This DCOM object was build with VB 6.

    Basically, there are flow of this service as below,
    createObject->invoke->release

    What happen is that it was failed at the win32.COM.dispatch:createObject which is the first service defined in the flow above.

    Below is the actual error message show in the webMethods developer, “win32.COM.WmDispatchException: Invalid class string. Error Code = 800401f3”.

    Could someone help me on this?

    Thanks.
    Renuka


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


  • 12.  RE: Invoking a COM object from webMethods

    Posted Wed January 11, 2006 12:01 PM

    Hi,

    I am trying to invoke a Dll function using invokeLate service, the Dll exists in the lib folder of the package, but it is giving following error

    win32.COM.WmDispatchException: Invalid class string. Error Code = 800401f3

    Please help.


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