1 ' Copyright (c) Microsoft Corporation. All Rights Reserved.
4 Imports System
.ServiceModel
6 Namespace Microsoft
.ServiceModel
.Samples
8 'The service contract is defined in generatedClient.vb, generated from the service by the svcutil tool.
10 'Client implementation code.
13 Public Shared
Sub Main()
16 ' Specify CalculatorEndpoint1 through CalculatorEndpoint4 to try various endpoints.
17 Dim client
As New CalculatorClient("CalculatorEndpoint1")
19 ' Call the Add service operation.
20 Dim value1
As Double = 100
21 Dim value2
As Double = 15.99
22 Dim result
As Double = client
.Add(value1
, value2
)
23 Console
.WriteLine("Add({0},{1}) = {2}", value1
, value2
, result
)
25 ' Call the Subtract service operation.
28 result
= client
.Subtract(value1
, value2
)
29 Console
.WriteLine("Subtract({0},{1}) = {2}", value1
, value2
, result
)
31 ' Call the Multiply service operation.
34 result
= client
.Multiply(value1
, value2
)
35 Console
.WriteLine("Multiply({0},{1}) = {2}", value1
, value2
, result
)
37 ' Call the Divide service operation.
40 result
= client
.Divide(value1
, value2
)
41 Console
.WriteLine("Divide({0},{1}) = {2}", value1
, value2
, result
)
43 'Closing the client gracefully closes the connection and cleans up resources
47 Console
.WriteLine("Press <ENTER> to terminate client.")