Part 1 Introduction to asp net web services

preview_player
Показать описание
Link for code samples used in the demo

If you are a foodie like me, I am sure you will enjoy the recipes on my friend's YouTube channel. If you find them useful, please subscribe and share to support her. She's really good at what she does.

Link for all dot net and sql server video tutorial playlists

In this video, we will discuss

Please Note: ASMX web services are a legacy technology. Most of the companies are now using WCF (Windows Communication Foundation) to build XML Web services and XML Web service clients. However, this course will be useful for those who are searching for a job as a dot net developer as there are some companies still using ASMX web services today, and could ask interview questions related to them.

In WCF video series we will discuss building XML Web Services and clients.

What are web services and why should we use web services?
Web services are a standardized way for developing interoperable applications i.e enabling an application to invoke a method of another application. These applications can be on the same computer or different computers. Web services use open standards and protocols like HTTP, XML and SOAP. Since these are open and well known protocols, applications built on any platform can interoperate with web services. For example, a JAVA application can interoperate with a web service built using .NET. Similarly a web service built using JAVA can be consumed by a .NET application.

Hyper Text Transfer Protocol (HTTP) is the protocl widely used by web services to send and receive messages.
The messaging protocol is SOAP. SOAP stands for Simple Object Access Protocol. SOAP messages are in XML format.

Building ASP.NET web services
Building ASP.NET web services is easy. Here are the steps.
Step 1: Create a an ASP.NET Empty Web Application and name it WebServicesDemo.

Web Services have .asmx extension. For this reason web services are also often called as ASMX web services.

Notice that a webservice is a class that is decorated with [WebService] attribute and inherits from System.Web.Services.WebService base class. The [WebService] attribute tells that the this class contains the code for a web service. WebService Namespace is used to uniquely identify your web service on the internet from other services that are already there on the Web. WebService Namespace can be any string, but it is common to give it a company's internet domain name as they are usually unique. Something like

using System.Web.Services;
namespace WebServicesDemo
{
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class CalculatorWebServices : System.Web.Services.WebService
{
[WebMethod]
public int Add(int firstNumber, int secondNumber)
{
return firstNumber + secondNumber;
}
}
}

Notice that, the CalculatorWebServices class contains a single method called Add(). This method adds 2 numbers and return the sum. This method is decorated with [WebMethod] attribute. If you want the method exposed as part of the Web service, then the method must be public and should be decorated with [WebMethod] attribute. This attribute has got several properties which can be used to configure the behavior of the XML Web service method. We will discuss these properties in a later video session.

At this point we are done building a web service. Run the application by pressing CTRL + F5.

Notice that the Add() method that we created in the web service is displayed on the page. Clicking on the method name will take you to page where you can test the method. This page also shows the format of the SOAP request and response messages.
Рекомендации по теме
Комментарии
Автор

Web Services finally... From the best public tutor online. God bless your work and give you strength to keep on sharing these tech concepts so straight, clear & proper. THE BEST OF THE BEST ! 

YK
Автор

@kudvenkat I swear your tutorials are the BEST!!!! ALL OF THEM!! Can't tell you how many different tuts belong to you that I have watched... THANKS A LOT!!! Greetings from Turkey!

berkanbilgin
Автор

Damn..you explain much better than my lecturer -_- ..nearly gave up on those projects. You're a lifesaver man! Looking forward to learn this whole series :)

deepak
Автор

I have to admit .. this is one of the best tut videos on Youtube .. Great Job

Nothingatall
Автор

Just awesome...
was strugling for two weeks regarding services, protocols, web application etc...
Within 30 min, got to know everything...
thanks... thanks a ton...

DIPANKARDAS
Автор

Web Services finally... From the best public tutor online. God bless your work and give you strength to keep on sharing these tech concepts so straight, clear & proper.

eugenesky
Автор

I must to thank you. I was ask you about web services few days ago and here it is, you posted video about that. Excellent.

miroslavstojakovic
Автор

Kudvenkat its a brand for dotnet vidoes .Iam big fan of ur video siriese, u r d real hero sir, hatsaf

naveennvn
Автор

Hi..!
Great
I am not a programmer but by watching this videos and my own practice on asp.net
now i can do what i want a lot

dhananjaykavare
Автор

Thanks a Lot..finally our wait is over ... You rocked Sir... :) 

manishmoon
Автор

You're very organized, explain very well and is entertaining. Thank you!

davidsoycolombiano
Автор

Dear sir, I really feel this is the best tutorial. You have explained it so nicely. Really thankful to you.

khyativaghela
Автор

Thank you very much for sharing. You have the best tutorials on the internet!

Andrei
Автор

we need remastered version of this, stay safe!

osmansahin
Автор

this is better than most tutorials... thank you

williamwsentamu
Автор

Great, Finally the wait is over. Thank U.

jeewanintube
Автор

Great sir views) are learn every concept from your

mageshwarank
Автор

Really you explained webservice very well.Its very useful for me.Thanks a lot....you are just awesome.here after if any of my friends having any doubt in weservice i will suggest your video only.really superb:)

renuradi
Автор

I started learning from here. Today I am a developer working for a company working both with .Net Technologies and Navision.

fibonacciforcrypto
Автор

Your work is excellent, and I'm very grateful for that. Please continue, so. Best Regards

jasjocka