TechBubbles

Impersonation and Delegation in WCF

 

Impersonation is a technique that WCF Services use to authorize the caller’s identity to access to service resources such as files and database tables. Service resources can be located either on local service machine or remotely hosted. The resources are being accessed by WCF Service’s process identity or specific windows identity.

Difference between Impersonation and Delegation in WCF?

Impersonation is used to access the resources when the resources are on the same machine as the service. Delegation is used to access the resources that are remotely hosted.

There are two types of Impersonation in WCF

  • Imperative Impersonation – Perform programmatically at run time
  • Declarative Impersonation – Applied with a static attribute which associated with an operation.

Read more

Related Posts:

1 comment

How to choose right WCF binding?

Binding in WCF defines how clients can connect with your service. The base class for all bindings in WCF is System.ServiceModel.Channels.Binding. A Binding includes definition for WS-* protocols used, the message encoding and the transport protocol.

The available WCF Bindings are

  • wsHttpBinding
  • basicHttpBinding
  • netTcpBinding
  • netNamedPipeBinding
  • netMsmqBinding
  • wsDualHttpBinding

Read more

Related Posts:

1 comment

Transport and Message Security in WCF

This post discusses about transport and message security. In Transport Security user credentials and claims are passed using transport layer. The transport protocols are TCP, HTTP, MSMQ and IPC. Each of these protocols have their own mechanism for passing user credentials. The most common approach is using secure socket layer(SSL) for encrypting the details which sent over HTTPS.

image 

Read more

Related Posts:

No comments

Service Orientation vs Object Orientation

Services are good communication technique to use across application and platform boundaries. Service-oriented approach always preferred when you are building a distributed application. Object orientation approach provides a view of what a system should look and effective for producing logical models. Object based approach can fail to consider real-world factors like physical distribution and network communication. This post compares the two approaches.

Object Orientation Service Orientation
Suitable in a homogeneous platform and
execution environment.
Suitable in a heterogeneous platform and
execution environment.
Shares types, not schemas. Shares schemas, not types.
Runs in cheap and transparent communication. The cost is variable and requires explicit communication.
Life-time of objects is maintained by the infrastructure. Services are autonomous –Security and failure isolation are necessary.
It requires synchronized deployment of both client and server. It allows continuous, separate deployment of client and server.
Provides no guide-lines for state management and ownership. It maintains and uses the reference state.
You can predict the sequence of events, timeframe and outcome of invocations. Message orientation approach and supports asynchronous and long-running communications.
Goal is to transparently use functions and types remotely. Goal is to provide inter-service isolation and interoperability based on standards.


Share this post :

Related Posts:

No comments

WCF 4.5 Features

 

This post discusses the new features in WCF 4.5. There have been significant improvements in WCF 4.5 on configuration.

Simplifying the generated configuration file in client

A client configuration file is generated when you add a service reference in Visual Studio 2010. The configuration files in earlier version of WCF contained the value of every binding property even if it is a default value. In WCF 4.5 Configuration files contain binding properties that are set to non-default value.

  Example of configuration file generated by WCF 3.0

Read more

Related Posts:

No comments

OData and Windows Azure

 

This post discusses about building a service using CLOUD platform that can reach various devices. What is OData and Where it fits in? OData is a specification that makes very easy to exchange and interact with data on the web. So OData is all about connecting up devices to the CLOUD. This post also discuss how to create a OData Service in Visual Studio 2010 and host it on Windows Azure then explains how to consume the service on Windows phone Mango.

What id OData?

A REST based set of patterns for accessing information via services

It is a great protocol for connecting devices to the CLOUD. The REST API’s which you might have developed having the following common requirements

  • Querying the data
  • Ordering the data
  • Paging the data
  • Filtering the data
  • Even CRUD operations on data

OData provides a common way to do the above operations. If you got your web API and if you use OData then you have got a wide range of options to expose of your data to various client libraries and platforms.

image

Read more

Related Posts:

No comments

WebSockets in ASP.NET 4.5

 

This post discuss about using WebSockets in ASP.NET 4.5. You can read this post to get an understanding about WebSockets. This post shows piece of code which uses WebSockets in ASP.NET 4.5 and the code is related to simple chat application.

The HTML of Web Form chat application looks as below

image 

It contains a text box where you can type your text message and button where it sends a message to the server. You can notice there is <ul> element which shows the list of other messages which are arriving from the server.

Read more

Related Posts:

No comments

WCF Services in Windows Azure

 

What is Windows Azure? Windows Azure provides developers computation power storage and can scale web applications on internet through Microsoft Datacenters. Developers can use Azure platform to build WCF service application using their existing Visual Studio 2010 expertise. image

Windows Azure supports the protocols and formats including SOAP, REST and XML. This post discuss about creating a simple WCF Service and hosting it on Windows Azure and consuming in client application.

1. Create a WCF Service Contract in Windows Class Library project as shown below which in-turn you use in Web role, worker role and in client application. Read more about roles in windows Azure here

   1: using System;

   2: using System.ServiceModel;

   3: namespace WCFContract

   4: {

   5:     [ServiceContract]

   6:     public interface IContract

   7:     {

   8:         // This operating returns the server information, including

   9:         // the role's name and instance id

  10:         [OperationContract]

  11:         string GetRoleInfo();

  12:  

  13:         // This operation returns the information of the channel

  14:         // being used between the client & the server.

  15:         [OperationContract]

  16:         string GetCommunicationChannel();

  17:     }

  18:  }

image

Read more

Related Posts:

1 comment

WCF AJAX Service Without Configuration

 

This post discusses how to develop Windows Communication Foundation (WCF) service using AJAX and without any configuration settings for WCF. This service can be consumed from Javascript. The service uses a special setting in .svc file which automatically enables an AJAX endpoint.

Read more

Related Posts:

No comments

WCF Service using MTOM in .NET FW 4

 

Web services having a greater interoperability to communicate messages across heterogeneous systems, however challenge is serializing the data into XML. Users may want to send images,videos, drawings, xml documents etc. together with SOAP message. 

What is MTOM?

Message Transmission Optimization Mechanism (MTOM) is a mechanism of transferring transferring large amounts binary data as an attachment to SOAP message.

Typical SOAP message transmission shown in the below image

MTOM Process

Image Source crosscheknet.com

Read more

Related Posts:

1 comment

Next Page »