July 14, 201015 yr Newbies Does anyone have, or willing to write a few lines of code, to demonstrate how to consume the sample 360works addtwonumbers and dividetwonumbers web services using Microsoft VB.NET? It would be a great help to a lot of people to get it working. Edited July 14, 201015 yr by Guest
July 14, 201015 yr Author Newbies Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim value1 As String Dim value2 As String Dim result As String Dim objWS As New acornTest.AddTwoNumbersRequest value1 = txt1.Text value2 = txt2.Text objWS.Addend1 = value1 objWS.Addend2 = value2 result = objWS.Equals(objWS) txtResult.Text = result.ToString End Sub Ive got as far as the above, but the web service is just returning true or false, where have I gone wrong and how can I get it to return the result from the web service to a variable?
July 15, 201015 yr Author Newbies Help! I can get the web service to return true or false. but the bit im stuck with is getting the Output Value!
July 20, 201015 yr Author Newbies Here is the code! very simple, I was just over complicating matters. Firstly create a web service reference inside visual studio and input the wsdl of the webservice. The code to consume and use the addtwonumbers sample web service is as follows:- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim value1 As String = txt1.Text Dim value2 As String = txt2.Text Dim wsResult As Object = ws.AddTwoNumbers(value1, value2) txtResult.Text = wsResult.OutputValue End Sub
Create an account or sign in to comment