Invoking a COM object from webMethods

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

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.

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

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

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

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

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

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.

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?

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?

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

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.