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?
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

0
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.
0
bergertimeAuthor Commented:
Did your code work for you?  I still can't get it to work.  Did you add it as a service reference?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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

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

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

Open in new window

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

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

0
bergertimeAuthor Commented:
Did you get it to return a value using Universal Windows App?
0
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

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
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.
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
Web Services

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.