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

x
  • 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 "http://189.1.26.52:9080/mtWeb/services/MTServicePort?wsdl"
    soapclient.ConnectorProperty("EndPointURL") = "http://189.1.26.52:9080/mtWeb/services/MTServicePort"

    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.

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

http:Q_21111980.html

http:Q_21113280.html

Hope this helps
0
 
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 "http://189.1.26.169:9080/mtWeb/services/MTServicePort?wsdl"
    soapclient.ConnectorProperty("EndPointURL") = "http://189.1.26.169:9080/mtWeb/services/MTServicePort"
   
    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
    Next
   
    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

0
 
sompol_kiatkamolchaiAuthor Commented:
It highlight on this line

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

set registerResponse = objM.register()

?
0

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