R4R Team working to provide free of cost for experienced and freshers

Tutorials | Examples|Interview Questions and Answers|Java Tutorials| C Tutorials | C++ Tutorials | Spring Tutorials| Hibernate Tutorials | JSP Tutorials | Servelets Tutorials| C# Tutorials | PHP Tutorials etc , Basics | Download Software | Data Types | Variables | Constant | Storage & Classes | Operators | Decisions Making | Loops | Functions| Numbers | Arrays | Pointers | String | Datastructure | Expressions | Preprocessor Statement | I/O | Exception Handling | OOPs Tutorial | Classes and object |C++ Inheritance Overloading | Polymorphism | Abstraction | Encapsulation | Interfaces | Multithreading etc

Web Services

SOAP IN Web services

SOAP Tutorial

How to Use web Services in Console Application using C#
Previous Home Next
Step 1: Open a new project and select console Application. press on Ok.
Step 2: Click on Add service reference a new window open Click on Advance.
A new window open click on Add Web reference and copy the URL of your running service and paste it to the URL space in new window shown below and click on Go. Click on Add reference but remember your Web reference name.
The Service will be added in your project.
Step 3: Written the following code in your Program (Program.cs).
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace Circlearea
{
    class Program
    {
       static void Main(string[] args)
        {
            localhost.Service lo = new localhost.Service();
            Console.Write("Please enter the value=");
            int area = Convert.ToInt32(Console.ReadLine());
            double fr=lo.CircleArea(area);
            Console.WriteLine("Area is =" + fr);
            Console.ReadLine();
        }
    }
}
Step 4: Run the Application
Previous Home Next