Video Tutorial on Developing Web Services using C#.NET and ASP.NET
Rate this article
5.00 out of 5
Developing a component which can be used to communicate between a Windows desktop application and a web based application is a daunting task in the past. We need to create a windows socket, develop the HTTP protocol module and send HTTP commands over the socket to the web server.

The emergence of web service technologies made the life of the developer easy as this is an HTTP communication framework which can be easily sited to the business requirements of any customers. This framework will enable the developer to easily develop routines that can communicate between desktop (or a web application) and  web application so that they can exchange messages easily which was otherwise difficult using traditional mechanisms like row windows sockets.

In this video tutorial, I will guide you on how to develop a C#.NET web service and call this web service from a windows based application. The tutorial will also show you how to create a web service using VS 2005, add a web service method, how to create the proxy class and how to use this proxy class in the windows application so as to communicate with the web service.

Please watch the you tube video below for more details..


Source Code
Services.cs

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    public Service () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }
    [WebMethod]
    public string Echo(string strEcho)
    {
        return strEcho;
    }
}

Forms1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EchoTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void ButonEcho_Click(object sender, EventArgs e)
        {
            Service EchoService = new Service();
            MessageBox.Show(EchoService.Echo(textBoxEcho.Text));
        }
    }
}



Download Source Code

Author :
Tom Thomas
Joined Date :12-Aug-2011
Articles
Posted
9
Messages
Posted
207
Mr. Tom is the Co-Founder and CTO of  KTS InfoTech.  He started his career as a C/C++ programmer in the late 90's and has been very active and passionate in programming since then. He had worked both in start-ups ( Infortech software Pvt Ltd) as well as in CMM Level 5 companies (NeST and Wipro Technologies) for clients like General Electric, Agilent, Hitachi, Toshiba, Fujitsu, Alcatel, Insurance Service Corporation etc. His experience as an Engineer, Architect, Project Manager, Chief Technical Officer and as a Teacher makes him ideal for any type of jobs related to Information Technology.

His role with his present employer includes exploring new business opportunities and partnerships, Developing software product frameworks, developing and executing marketing strategies for company products etc.  

He holds Masters degree in Physics and Computer Science form CUSAT , one of the premier Science and Technology Institutions in India .

His major interests are in Optical Networking, Robotics, Device drivers, Database, Graphics, web applications, Software product Engineering, Open source Technologies and Sports physics.

He resides in Kerala ,India, with his mother, wife and his little angel.

He can be reached on Skype at this ID thomas_tom99 or at his E Mail address tom.thomas (at)ktsinfotech.com

         

   
Messages
Posted:
Post Your Comments
Name (Max 50 Chars)
Comments

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud