Last post Mar 19, 2016 11:54 AM by isha3388
Mar 01, 2016 05:55 PM|sudip_inn|LINK
client call web api and web api return data in json format, or xml format etc. but people can develop asmx service which can return data in json format and same wcf also can return data in json format too then why web api?
people say web api is http service........what does it means ?
asmx or wcf do not support http ?
guide me. thanks
Mar 01, 2016 06:15 PM|PatriceSc|LINK
Yes there is some overlap. See
https://msdn.microsoft.com/en-us/library/jj823172(v=vs.110).aspx for a WCF/web API comparison. Web API is more direct and more consistent with the MVC model (based on routing, controllers and actions; it even merged in ASP.NET Core 1.0).
If you are using WCF and ASMX and that it fit your needs, no problem. For new projects it's likely best:
- if this is a particular purpose you can consider using MVC (for example an autocomplete service used just from a particular view)
- if this is really an API, web API
- if you need its unique feature (non HTTP for example, web api is http *only*) then WCF (that does as well what ASMX does).
Mar 01, 2016 06:20 PM|sudip_inn|LINK
do not understand this point.........if you need its unique feature (non HTTP for example, web api is http *only*) then WCF (that does as well what ASMX does).
Mar 02, 2016 04:09 AM|santhoshje|LINK
based on who is consuming the service and service security requirements.
Mar 02, 2016 04:52 AM|Yohann Lu|LINK
Web API is the great framework for exposing your data and service to different-different devices. Unlike WCF Rest service, it use the full features of HTTP (like URIs,request/response headers, caching, versioning, various content formats).
It also supports MVC features, like routing, controller, action, filter, model binding, Inversion of Control (IOC) or dependency injection (DI), unit testing. These can make the program simpler, more robust.
Web API is a lightweight frame and restrictions on bandwidth devices, such as smart phones and other supported well. Web API Response can be converted into the MediaTypeFormatter Json, XML or any format you want to convert. And it is uniquely suited to the
mobile client service.
You can consider using the Web API when you encounter the following situations.
1. If we need a Web Service and don’t need SOAP, then ASP.Net Web API is best choice.
2. It is Used to build simple, non-SOAP-based HTTP Services on top of existing WCF message pipeline.
3. It doesn't have tedious and extensive configuration like WCF REST service.
4. Simple service creation with Web API. With WCF REST Services, service creation is difficult.
5. It is only based on HTTP and easy to define, expose and consume in a REST-ful way.
6. It is light weight architecture and good for devices which have limited bandwidth like smart phones.
Mar 02, 2016 07:51 AM|sudip_inn|LINK
@santhoshje : what do u mean "Web Api is rest based " ?
just come with some example to explain the meaning of rest based. thanks
Mar 02, 2016 07:53 AM|sudip_inn|LINK
@Yohann Lu what do u mean by "restrictions on bandwidth devices" ??
please explain what u try to say. thanks
Mar 02, 2016 09:22 AM|Yohann Lu|LINK
what do u mean by "restrictions on bandwidth devices" ??
As far as I know, when we use some of the equipment, It can only accept relatively limited data at the same time. Web API is a lightweight architecture and good for these devices.
If your client is a mobile device, the traffic issues is that everyone should pay attention to the problem of mobile applications.
Mar 03, 2016 01:59 AM|santhoshje|LINK
Representational State Transfer (REST) is an architectural style with following features
URI - Each resource can be accessed with a unique uri
Representations - Resources can be represented by formats like JSON, XML, Text etc
Uniform interface - Resources can be manipulated using GET, POST, PUT And Delete methods
Mar 19, 2016 11:54 AM|isha3388|LINK
for web api go through the following link:-