Beispiel #1
0
        protected void Invoke_Click(object sender, EventArgs e)
        {
            // Create the client.
            UseTheService.TheServiceClient Client =
                new UseTheService.TheServiceClient();

            // Use the client to invoke the web service.
            Result.Text = Client.DoAdd(
                Int32.Parse(Value1.Text),
                Int32.Parse(Value2.Text)).ToString();
        }
Beispiel #2
0
        protected void InvokeContract_Click(object sender, EventArgs e)
        {
            // Create the client.
            UseTheService.TheServiceClient Client =
                new UseTheService.TheServiceClient();

            // Obtain the input data.
            UseTheService.InputType inData =
                new UseTheService.InputType();
            inData.Value1Value = Int32.Parse(Value1.Text);
            inData.Value2Value = Int32.Parse(Value2.Text);

            // Use the client to invoke the web service.
            UseTheService.ResultType outData =
                Client.DoAddUsingDataContract(inData);

            // Display the data on screen.
            Result.Text = outData.ResultValue.ToString();
        }