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.
LVL 2
bergertimeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

ste5anSenior DeveloperCommented:
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

bergertimeAuthor Commented:
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.
bergertimeAuthor Commented:
Did your code work for you?  I still can't get it to work.  Did you add it as a service reference?
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

bergertimeAuthor Commented:
Still can not get this to work.
louisfrCommented:
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

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

Capture.JPG
louisfrCommented:
Try passing the endpointConfigurationName:
Dim client As New TempConvert.QIWSSAMPLEServicesClient("QIWSSAMPLEServicesPort")

Open in new window

bergertimeAuthor Commented:
I tried that, but I get intellisense popping up.

Capture.JPG
bergertimeAuthor Commented:
Any idea on getting this to work?
louisfrCommented:
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

bergertimeAuthor Commented:
Did you get it to return a value using Universal Windows App?
louisfrCommented:
I had no idea what I was doing, but I made it work.
        Dim client As New TempConvert.QIWSSAMPLEServicesClient(New BasicHttpBinding, New ServiceModel.EndpointAddress("http://24.249.118.65:10032/web/services/QIWSSAMPLEService/QIWSSAMPLE?wsdl"))
        Dim convertInput = New TempConvert.converttempInput
        convertInput.TEMPIN = 123
        Dim task = client.converttempAsync(convertInput)
        Dim convertOutput = task.Result.return

Open in new window

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
bergertimeAuthor Commented:
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.
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
Web Services

From novice to tech pro — start learning today.