Error testing wmVBDemo sample using B2B 4.0

I followed the B2BIntegratorGuide (Writing a Visual Basic Service) to test wmVBDemo example:

$progid set to wmVBDemo.Services
$methodname set to helloWorld
$context is INPROC

I compiled the wmVBDemo.dll then moved it to webMethods/B2BServer4/packages/WmWin32/code/libs

But got error – “invalid class string”, then in addition to the instructions, I tried to use comwrap.bat to create Wrapper class(I have MS java SDK installed), but got error - ERROR: Could not execute The system cannot find the file specified.

Is there anyone knows what the problem is?
What is the requirement for the setup?

thanks your help.


I tried to remove duplicate registry of wmVBDemo.dll, but still failed, so I made changes to DLL(as in step 4), but when run invokeLate flow, I got:
message box:
Could not run the service “testVB”
win32.COM.WmDispatchException: (null). Error Code = 8002000f

Call Stack shows win32.COM.dispatch:invoke failed

also I got exception from the command window where I run server.bat
“Illegal Monitor State Exception: JVMLK002: current thread not owner”

I don’t know if the DLL is not built right, or the flow in webMethods is not correct?

Following is the settings:

  1. I logon as Administrator

  2. I created TEST folder under Default, then created a testVB flow service, then select invokeLate from WmWin32 package

  3. created name as input String, message as output String

  4. the flow parameters as following


Pipeline In Service In Service Out Pipeline Out
– T name - T $progid (value is MyVBTest.Services) - T $progid
- T $methodName(value is helloWorld) - T $methodName
- T $context (value is INPROC) - T $context
- T server - T name
- T user - T message
- T password
- T domain
- T params
(Note: server, user, password, domain, params is not set any value)
Attached view as a html(TESTtestVB.htm):

  1. I created/registered a MyVBTest.dll with the same Services.cls
    the MyVBTest.IDL generated from OLE/COM Object Viewer as:

// Generated .IDL file (by the OLE/COM Object Viewer)
// typelib filename: MyVBTest.dll

library MyVBTest
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
// TLib : webMethods 4.0 Type Library : {F75CFD90-9BD2-11D4-A435-0050040539E2}

// Forward declare all types defined in this typelib
interface _Services;

interface _Services : IDispatch {
    HRESULT helloWorld([in, out] _Values** inputs);

coclass Services {
    [default] interface _Services;


I am new to WebMethods and not familiar with VB/COM, could any one take a look at those steps?


I actually tried this a week ago, I did have problems initially, but I used the early
binding method of invoking the dll.

eg. wmWin32/win32/COM/invoke

make sure the class name is

  • wmVBDemo.Services
  • Method is helloWorld
    you need two parameters
    name as input parameter
    message as output parameter

I am having the same problem.
Have you been able to get anywhere…

Hi Joseph,
Did you got solution for the above error? We also tried that example and getting the same error! What is the cause for that? Pl. reply immediately.