[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4089
  • Last Modified:

VB6 and Webservice problem.

Hi experts,

I have an urgent problem.

I try to call webservice in J2EE platform from VB6 client.

Here is my code

    Set soapclient = New MSSOAPLib30.SoapClient30
    soapclient.MSSoapInit ""
    soapclient.ConnectorProperty("EndPointURL") = ""

    Dim tmp As String
-->    tmp = soapclient.register("1", "1", "1", "1", "1", "1", "1", "1")
    Debug.Print tmp

It shows

Run-time error '450':
Wrong number of arguments or invalid property assignment

I implement register method to return JavaBean and this JavaBean is converted automatically by Axis to SOAP message.

I am very quite sure that my program can connect to webservice and have the correct number of arguments.
I think the problem comes from the incompatible platform between VB6 and Java.

Does anyone face the problem like this before?

Any help would be appreciated.

Thanks in advance.

  • 2
  • 2
1 Solution
Ryan ChongCommented:
Try use the DOMDocument object in MSXML object maybe, try view my PAQ for more info:



Hope this helps
sompol_kiatkamolchaiAuthor Commented:
Thanks ryancys, Your example is so good. Now I can get xml from the response.

But I have a problem in returning complex data type from ActiveX DLL to the caller.

Here is my code in DLL file.

Public Function register() As Complex.RegisterResponseBean
    Set soapclient = New MSSOAPLib30.SoapClient30
    soapclient.MSSoapInit ""
    soapclient.ConnectorProperty("EndPointURL") = ""
    Dim retList As IXMLDOMNodeList
    Dim node As IXMLDOMNode
    Set retList = soapclient.register("1", "1", "1", "1", "1", "1", "1", "1")
    Set registerResponse = New Complex.RegisterResponseBean
    For Each node In retList
        If node.nodeName = "success" Then
            registerResponse.success = node.Text
        End If
        If node.nodeName = "code" Then
            registerResponse.code = node.Text
        End If
        If node.nodeName = "description" Then
            registerResponse.Description = node.Text
        End If
    register = registerResponse
End Function

and here is my VB client that calls MTTR.dll

Private objM As MTTR.MTTRClass
Private registerResponse As Complex.RegisterResponseBean

Private Sub cmdRegister_Click()
    Set objM = New MTTR.MTTRClass
    registerResponse = objM.register()
    Set objM = Nothing
End Sub

and I get this error when I click on cmdRegister Button

Run-time error '91':

Object variable or With block variable not set

sompol_kiatkamolchaiAuthor Commented:
It highlight on this line

==> registerResponse = objM.register()
Ryan ChongCommented:

set registerResponse = objM.register()


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now