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
LVL 11
sompol_kiatkamolchaiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.