Link to home
Start Free TrialLog in
Avatar of bergertime
bergertime

asked on

VB.net and soap

I set up a web service, it converts temperature, the url is http://24.249.118.65:10032/web/services/QIWSSAMPLEService/QIWSSAMPLE?wsdl.

What's would be the code in vb to use the service?  I'm trying to do it in Visual Studio 2015 with Universal Apps.
Avatar of ste5an
ste5an
Flag of Germany image

Why not importing it as a service reference?

Module Module1

    Sub Main()

        Dim qiwService As QiwService.QIWSSAMPLEServicesClient
        Dim convertInput As QiwService.converttempInput
        Dim convertOutput As QiwService.converttempResult

        qiwService = New QiwService.QIWSSAMPLEServicesClient("QIWSSAMPLEServicesPort")
        convertInput = New QiwService.converttempInput
        convertInput.TEMPIN = 123
        convertOutput = qiwService.converttemp(convertInput)

        Console.WriteLine("Done.")
        Console.ReadLine()

    End Sub

End Module

Open in new window

Avatar of bergertime
bergertime

ASKER

In my universal app, I add it as a service reference.  I just can't get the button event to return a value.  Let me see what your code gets me.
Did your code work for you?  I still can't get it to work.  Did you add it as a service reference?
Still can not get this to work.
From your other question's solution, I think you cannot use the synchronous method.
Use the asynchronous one:
Dim task = qiwService.converttempAsync(convertInput)
convertOutput = task.Result.return

Open in new window

Let me try this.  Thanks
I get a different error message than last time.   See below.

User generated image
Try passing the endpointConfigurationName:
Dim client As New TempConvert.QIWSSAMPLEServicesClient("QIWSSAMPLEServicesPort")

Open in new window

I tried that, but I get intellisense popping up.

User generated image
Any idea on getting this to work?
You could try this (I took the values from my app.config):
Dim client As New TempConvert.QIWSSAMPLEServicesClient(New ServiceModel.Channels.CustomBinding("QIWSSAMPLEServicesPortBinding"), New ServiceModel.EndpointAddress("http://24.249.118.65:10032/web/services/QIWSSAMPLEService/QIWSSAMPLE"))

Open in new window

Did you get it to return a value using Universal Windows App?
ASKER CERTIFIED SOLUTION
Avatar of louisfr
louisfr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are amazing.  I tried everything I could think of.  I added the bottom line to return the value to a textbox.

 Dim convertOutput = task.Result.return
  textBox.Text = convertOutput.TEMPOUT.ToString

Again, thank you.