Oldarabieats

asp.net web api – What is the difference between a web API and a web service?

Difference between Web Service and Web API nicely explained here:

https://softwareengineering.stackexchange.com/questions/38691/difference-between-web-api-and-web-service

Text from the link:

Web Services – that’s standard defined by W3C, so they can be accessed semi-automatically or automatically (WSDL / UDDI). The whole thing is based on XML, so anyone can call it. And every aspect of the service is very well defined. There’s parameters description standard, parameter passing standard, response standard, discovery standard, etc. etc. You could probably write 2000 pages book that’d describe the standard. There are even some “additional” standards for doing “standard” things, like authentication.

Despite the fact that automatic invoking and discovery is barely working because clients are rather poor, and you have no real guarantee that any service can be called from any client.

Web API is typically done as HTTP/REST, nothing is defined, output can be for eg. JSON/XML, input can be XML/JSON/or plain data. There are no standards for

Read More

ASP.NET Web Service Basics

Introduction

We can now use ASP.NET to create Web Services based on industrial standards including XML, SOAP, and WSDL.

A Web Service is a software program that uses XML to exchange information with other software via common internet protocols. In a simple sense, Web Services are a way of interacting with objects over the Internet.

A web service is

  • Language Independent.
  • Protocol Independent.
  • Platform Independent.
  • It assumes a stateless service architecture.
  • Scalable (e.g. multiplying two numbers together to an entire customer-relationship management system).
  • Programmable (encapsulates a task).
  • Based on XML (open, text-based standard).
  • Self-describing (metadata for access and use).
  • Discoverable (search and locate in registries)- ability of applications and developers to search for and locate desired Web services through registries. This is based on UDDI.

Web Service History

  • Microsoft coined the term “Web services” in June 2000, when the company introduced Web services as a key component of its .Net
Read More

How to Create a Simple Web Service and Use it in ASP.Net

Introduction

 

This article describes how to create a web service in ASP.NET and use it in a client application.

 

What is Web Service?

 

A Web Service is a reusable piece of code used to communicate among Heterogeneous Applications.

 

Once a web service is created and hosted on the server in the internet it can be consumed by any kind of application developed in any technology.

 

How to create a Web Service

 

Step 1

 

Go to Visual Studio then click on “File” -> “Website” -> “ASP.NET empty website template”.

 

Then provide the website name (for example: WebServiceSample).

 

1.jpg 

 

Step 2 Add a Web Service File

 

Go to Solution Explorer, then select the solution then click on “Add new item”.

 

Choose the Web Service template.

 

Enter the name (for example: Airthmatic.cs) then click on “Add”.

 

2.jpeg 

 

This will create the following two files:

  1. Airthmatic.asmx (the service file)
  2. Airthmatic.cs (the code file for the service;
Read More