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.
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)
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
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
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?
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