Wednesday 30 April 2014

Applications in ASP.Net and WCF - Some Differences

.NET Development
There is a lot to be discussed about the difference between ASP.Net and WCF or Windows Communication Foundation.

What ASP. NET Web API is
First of all, let us know what actually ASP. NET Web API is. It is actually a framework that utilizes HTTP services and in the process, makes it easier to respond to the requests raised by the clients. The response provided depends upon the type or nature of the requests. The main function of the Web API is to build the HTTP services, along with handling the requests by using various HTTP driven protocols. Hence, it can well be said that ASP. NET Web API is an HTTP service that uses typical HTTP applications and is designed to reach a wider spectrum of clients having a wide range of requirements.

ASP.Net Web based API is used to create RESTful or Representational State Transfer services. Some of the salient features of the ASP.Net Web API are discussed below.

  • It supports various features of MVC applications
  • It is a typical REST services platform
  • It is a HTTP service creating framework
  • It comes up with API MediaType Formatter that can format the responses into JSON or JavaScript Object Notation as well as XML or Extencible Markup Language.

Choosing between WCF and Web API

Web API
  • For creating a service with all HTTP features, you need to choose Web API. Some of these features include request headers and response headers, versioning, URIs and the likes.
  • Choosing API becomes imperative when there is need for exposing HTTP services to a wider spectrum of clients through mobiles, iPhones, browsers and so on.

WCF
  • WCF is generally chosen when creating any service that would support one-way messaging, duplex communication, message queues and so on.
  • It is also chosen for creating services that utilizes a quick transport channel like UDP, TCP, named pipe criteria etc.

Choosing Web API over ACF or the other way round

Interoperability Of The Clients
RESTful services and particularly API, mainly put emphasis on simplicity. Applications that can access websites as well as RESTful services by using HTTP calls. This may differ from the SOAP, where clients need to understand the web service by using similar HTTP calls. This is different from the SOAP where clients need to understand the web service with the utilization of WSDL file. WSDL configuration makes things to some extent complicated and needs some additional logic that a lot of devices might not come up with. These devices include phones, interactive TVs and so on.

In short, let us discuss the features of the two frameworks so that the readers have a thorough idea.

WCF
  • The ServiceContract as well as OperationContract attributes are generally utilized to define the WCF service
  • It Supports a number of protocols such as Named Pipes, TCP, HTTP, MSMQ, HTTPS, and TCP
  • Hosted by IIS, Windows Activation Service or WAS, Self-hosting, as well as Windows Service
  • Supports fast as well as reliable messaging security, absolutely safe, quick and foolproof transaction along with AJAX and REST support.
  • Supports DataContract serializer with the use of System.Runtime.Serialization
  • Supports Request-Response, One-Way, as well as Duplex service operations
  • WCF is much faster than the Web Services
  • There is the option of serializing the Hash Table.
  •  Unhandled Exceptions do not get back to the clients as in SOAP faults. WCF supports a better handling of exceptions with the use of FaultContract.
  • Supports XML, MTOM, as well as Binary encoding of messages.
  • Supports multi-threading with the use of ServiceBehaviour class

ASP.NET Web Service
  • WebService as well as WebMethod attributes is used to define a web service.
  • Supports only HTTP and HTTPS protocols.
  • Hosted solely in IIS.
  • Support security but it is considered less safe than the WCF.
  • Supports serializer of XML with the use of System.Xml.Serialization
  • Supports One-Way as well as operations of Request-Response service.
  • Web Services are much lower than the WCF in terms of speed
  • One cannot serialize Hash Table. It can be done with only those selective collections that implement IEnumerable as well as ICollection.
  • Unhandled Exceptions are returned as SOAP faults to the clients.
  • Supports XML as well as Message Transmission Optimization Mechanism or MTOM message encoding.
  • Does not support multi-threading

You can get in touch with a .net development company who can help you develop web apps that are stable, scalable and secure.

We provide .net application development services. If you would like to hire dot net programmers for your development needs, please contact us Mindfire Solutions.

Wednesday 9 April 2014

New Features In ASP.NET 4.5 Webforms

.net development services
The new version 4.5 of ASP.NET Web Forms has come up with a string of latest value-added features that are specifically designed as well as developed for superior user experience, that come in handy at the time of working with huge databases.

In all the earlier versions of ASP.NET, the users had to use various expressions like Bind() and Eval() while using data-binding for deriving the object member value. However, in case of the latest version, the users will be able to declare the type or class of the control-bound data with the use of the new ItemType property. Once this property is set, the user will be able to use a strong variable for receiving the benefits that Visual Studio features. Some of the benefits include effective member navigation, IntelliSense, compilation-time checking option and so on.

The latest data-bound controlling features also help the users to specify customized methods that may be used to select, update, modify, delete, or insert data, and to simplify the interactions between application logics and page controls. Besides, the latest version also comes up with a latest model binding feature that helps users to map the data directly from the page into the method parameters.

Validation of user input has become much easier in the latest version which helps users to annotate the customized model classes with various attributes of validation from the System.ComponentModel.DataAnnotations namespace.

The new 4.5 version of the web form also integrates jQuery with the client end validation and that provides a much cleaner as well as more composite client-end codes along with the standard features of JavaScript.

Besides, with the introduction of the new version the area that is designated for requesting validation has seen certain improvements. These new features make it much easier for the users to deactivate the request validations selectively, for certain definite parts of the application. Also, going through the request data that have been invalidated, becomes much easier in the newer version.

The server controls of the new version of the Web Form have undergone significant facelift specifically with a view to take maximum advantage provided by the new HTML5 features.

TextMode Property
TextMode Property of the TextBox control has gone through a major modification for supporting the input types like datetime, email etc that HTML5 features.

FileUpload Control
FileUpload Control of the new version can now support upload of multiple files simultaneously from the browsers that support this unique feature of HTML5.

Improved Validator Controls
Improved Validator Controls of the newer version support validation of the input elements that HTML5 comes up with.

UpdatePanel control
The new UpdatePanel control is specifically designed for supporting posting of the input fields that are customary with HTML5.

Client Side JavaScript APIs
The new version also comes up with the client side JavaScript APIs that can be used for initiating connections, sending and receiving messages to and from the server.

Server Side APIs
ASP.NET 4.5 provides improved APIs that the users can easily use for writing codes that specifically accept the WebSocket request from the clients and upgrade HTTP for receiving WebSocket requests.

Improved features of Request Validation
Request Validation is one of the most significant features that have been incorporated in the new version. The new feature examines all the incoming requests to ensure whether they contain harmful contents or not.

Improved Pocket
The latest avatar comes up with an improved pocket that has two features – Deferred Request Validation and ValidateRequestMode property.

Other features that the latest ASP.NET comes up with include Text Box TextMode properties, that supports increased number of values like datetime and email, and huge number of HTML5 controls that support runat=”server” attribute for supporting the “~” sign when it specifies a particular URL.

Also there is an improved File upload control that supports uploading multiple files. You can get in touch with a custom .net development company who can help you with your .Net software projects.

We provide .net development services. If you would like to hire .net developers for your development needs, please contact us at Mindfire Solutions.