Posts

Showing posts from September, 2010

Security in WCF

Image
The first step to securing a WCF service is defining the security policy. Once you have established requirements for authentication, authorization, and message protection it is a matter of service configuration to enforce it. Your binding selection will influence the available configuration options for the service security policy. When you expose a service endpoint you select a binding that represents the appropriate communication protocol and message encoding format. For example, for intranet communications or systems behind the firewall, TCP protocol with binary message encoding is usually preferred. For Internet access, HTTP protocol is a typical choice using text or MTOM encoding (depending on the message size). A standard set of bindings satisfy these protocol and encoding choices. NetTcpBinding is the right choice for binary TCP communications that cross machine boundaries, BasicHttpBinding is the right choice for HTTP communications that must support legacy Web service protoco...

Interview Questions - Part 1

What is JQuery JQuery is a light weight JavaScript library which provides fast and easy way of HTML DOM traversing and manipulation, its event handling, its client side animations, etc. One of the greatest features of jQuery is that jQuery supports an efficient way to implement AJAX applications because of its light weight nature and make normalize and efficient web programs. What are the advantages of jQuery The advantages of using jQuery are: 1. JavaScript enhancement without the overhead of learning new syntax 2. Ability to keep the code simple, clear, readable and reusable 3. Eradication of the requirement of writing repetitious and complex loops and DOM scripting library calls

Serialization and Generics in WCF

Recently, I have been spending some time blogging about serialization. This is a small effort to go back over some of the basics prior to starting on WCF. Today, I am continuing the serialization subject by taking a closer look at generics in regards to serialization. This is actually a popular subject for a lot of newcomers to WCF. Many developers who are fond of generics will create a service that exposes some generic method. When they finally get ready to fire up the service and give it a trial run, they are quickly disappointed to discover that it doesn't work as expected. So, what should be done...? WCF does not support the use of generic methods for service operation . In other words, only concrete types can be used for service operations. Open generic types cannot be used. Now, it is important to clarify this is not a limitation of WCF. Rather, it is a limitation of WSDL, which is used to expose service metadata to consumers. There is no construct within WSDL to d...

Model View Controller

Image
Context The purpose of many computer systems is to retrieve data from a data store and display it for the user. After the user changes the data, the system stores the updates in the data store. Because the key flow of information is between the data store and the user interface, you might be inclined to tie these two pieces together to reduce the amount of coding and to improve application performance. However, this seemingly natural approach has some significant problems. One problem is that the user interface tends to change much more frequently than the data storage system. Another problem with coupling the data and user interface pieces is that business applications tend to incorporate business logic that goes far beyond data transmission. Problem How do you modularize the user interface functionality of a Web application so that you can easily modify the individual parts? Forces The following forces act on a system within this context and must be reconciled as you consider a solut...

Windows Communication Foundation - FAQ

Image
Difference between Web Service and WCF? Major Difference is That Web Services Use XmlSerializer But WCF Uses DataContractSerializer which is better in Performance as Compared to XmlSerializer. Key issues with XmlSerializer to serialize .NET types to XML Only Public fields or Properties of .NET types can be translated into XML. Only the classes which implement IEnumerable interface. Classes that implement the IDictionary interface, such as Hash table can not be serialized. The DataContractAttribute can be applied to the class or a strcture. DataMemberAttribute can be applied to field or a property and theses fields or properties can be either public or private. Web Services : 1.It Can be accessed only over HTTP 2.It works in stateless environment WCF : WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services; IIS WAS Self-hosting Managed Windows Service Important difference ...