Hi,
I am planning to use the concept of web services in my asp.net project.
but i don't have any idea about web services.
so will you please help me for this.
Thanks.
Hi,
I am planning to use the concept of web services in my asp.net project.
but i don't have any idea about web services.
so will you please help me for this.
Thanks.
Web Service
Web Service is a software component for application to application communication. Web services use XML based communicating protocols.
In Microsoft .Net there are some advanced concepts of enterprises services available, like Web Services and .Net Remoting.
ASP.NET Web services and .NET remoting are two separate paradigms for building distributed applications using Internet-friendly protocols and the .NET framework.
Web services typically use SOAP for the message format and require that you use IIS for the HTTP message transport. This makes Web services good for communication over the Internet, and for communication between non-Windows systems. Web services are a good choice for message-oriented services that must support a wide range of client platforms and a potentially heavy load.
Remoting can be configured to use either SOAP or Microsoft's proprietary binary protocol for communication. The binary protocol yields higher performance, and is great for .NET to .NET communication, but cannot be used to communicate with non-Windows platforms. Remoting does not require an IIS Web server, making it a good choice for peer-to-peer development, but this also means that it cannot leverage the scalability and performance of IIS to support a high number of connections or requests per second.
You can use this code.
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 ()
{
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public int add(int a, int b)
{
return a + b;
}
}
Here the HelloWorld function is default function when we create the web service project.
The add function which is have two parameters (a & b) and return an integer value.
Here we should have to give the parameter when clicking the add function.
After you will get the xml file.
Bookmarks