Click here to Skip to main content
15,504,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I do this:
-open a new Windows application
-add a Service References
-change de Name Space to ws1 and clic accept

Here I receive the first surprise. Insted of see the list of methods handle by the webservice, I see an icon

In the App.config file I can see this
<client>
       <endpoint address="http://cwp-vm-matrixw/Tiendas/service.asmx"
           binding="basicHttpBinding" bindingConfiguration="ServiceSoap"
           contract="ws1.ServiceSoap" name="ServiceSoap" />
   </client>


What I have tried:

inside de code I try to write this: Dim wsMio As New ws1.ServiceSoap, but I receive the error "New can not be used in an interface"

When I write Dim wsMio As ws1.ServiceSoap I can go ahead

Private Sub Bt(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim wsMio As ws1.ServiceSoap
TextBox1.Text = wsMio.Dobla(5)
End Sub

In this case when I write wsMio. I can see the list of methods, choose Dobla (duplicate a value in spanish) and the code is accepted and I let out a deep sigh, but when I clic the button, instead of receive the value 10 I receive an error: Object reference not set to an instance of an object. Use the word New to create an instance of the object.

Any idea to continue?
Is it ok not receive the list of methods when I add the service reference?
How can I declare a new instance of the object ws1?
Posted
Updated 19-Aug-21 13:12pm

1 solution

A quick Google search came up with the following examples on how to consume a web service/REST API call within VB6.

Here is the first link to a Stack Overflow article
Here is the second link with examples on Github.com
Here is the third link on the VB Forums website.

There are a number of good examples in these three resources that should be able to get you going on your project.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900