tag:blogger.com,1999:blog-46224157121180694412024-03-19T10:11:06.216+02:00Daylight in .NETlet's make some lightAnonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-4622415712118069441.post-8860684397365916042013-11-28T12:27:00.002+02:002013-11-28T12:30:26.757+02:00Deal with authentication in AngularJS<div class="MsoTitle">
<div class="MsoTitle">
<span style="font-family: Verdana, sans-serif; font-size: large;"><b><span style="color: #444444;">What is Authentication?</span></b></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">Authentication
is the process of identifying a user that wants to access a protected resource.
We use authentication is our everyday lives: ID cards, user names and
passwords, security cards, etc. The process that comes next is called
‘Authorization’ and they are very strong related and sometimes confused. With
‘Authorization’, we can check for user rights and see if they have or not
access to a specific resource after they have been authenticated. However, make
no mistake; there could be no ‘Authorization’ without ‘Authentication’. In this
article we will discuss about the process of identifying ‘who is this user’
using AngularJS.<o:p></o:p></span></span><br />
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><br /></span></span></div>
<div style="border-bottom: solid #90C226 1.0pt; border: none; mso-border-bottom-alt: solid #90C226 .5pt; mso-border-bottom-themecolor: accent1; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;">Considerations</span><o:p></o:p></span></span></h1>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Verdana, sans-serif;">Remember
that all actions take place on the client side, which means that the client has
full control over the browser and can overpass security checks. Therefore, it
is very important to make the verification on the back-end also.</span><br />
<span style="color: #444444; font-family: Verdana, sans-serif;"><br /></span></div>
<div style="border-bottom: solid #90C226 1.0pt; border: none; mso-border-bottom-alt: solid #90C226 .5pt; mso-border-bottom-themecolor: accent1; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;">Setting up client-side
Routing</span><o:p></o:p></span></span></h1>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Verdana, sans-serif;">Here we can
decide which pages will need authentication and set the routing for the
application. A route is defined providing at least the template or templateUrl
and the controller of that page. In addition, I have added the ‘access’
property with ‘allowAnonymous’ attribute. This way we now if the current route
needs authentication or it is a free access page. In our example we have the
‘Login’ page which is accessible by anyone and the ‘MembersPage’ that needs
authentication.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: Consolas;">// in app.js</span><span style="font-family: "Verdana","sans-serif";"><o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: Consolas;">var myApp =
angular.module('myApp',['ngResource', 'ngCookies', 'ngRoute']); myApp.config(function ($httpProvider,
$routeProvider) {</span><span style="font-family: "Verdana","sans-serif";"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> window.routes = {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> '/Login': <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 70.8pt; text-indent: 35.4pt;">
<span style="font-family: Consolas;"><span style="color: #444444;">{
templateUrl: '/Account/Login', <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 106.2pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> controller: 'AccountController', <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 106.2pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> access : {allowAnonymous : true} <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 106.2pt;">
<span style="font-family: Consolas;"><span style="color: #444444;">},<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> '/MembersPage: <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 70.8pt; text-indent: 35.4pt;">
<span style="font-family: Consolas;"><span style="color: #444444;">{
templateUrl: '/Home/SomePage, <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 106.2pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> controller: SomePageController', <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 106.2pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> access: {allowAnonymous:false}}};<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> for (var path in
window.routes) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> $routeProvider.when(path,
window.routes[path]);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas;"><span style="color: #444444;">
$routeProvider.otherwise({ redirectTo: '/Login' });<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Consolas;"><span style="color: #444444;"> });
<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">The next
thing to do is to recognize an authenticated user and check if it has access to
the routes.<o:p></o:p></span></span><br />
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><br /></span></span></div>
<div style="border-bottom: solid #90C226 1.0pt; border: none; mso-border-bottom-alt: solid #90C226 .5pt; mso-border-bottom-themecolor: accent1; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;">Recognize an authenticated
user</span><o:p></o:p></span></span></h1>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Verdana, sans-serif;">There are
several ways for doing that but I prefer using the power of AngularJS
throughout the use of ‘Services’. Therefore, I have created a ‘UserService’
where we store the current user name and a value-indicating if is authenticated
or not.</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">// in UserService.js<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">myApp.factory('userService', function () {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> var user
= {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
isLogged: false,<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
username: '', <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> };<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> var
reset = function() {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
user.isLogged = false;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
user.username = '';<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> };<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> return {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
user: user,<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
reset : reset<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> };<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;"><span style="color: #444444;">});<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: "Verdana","sans-serif";">After we
have the service in place, it is time to use it and implement the check
functionality for a route. There are several methods that intercept the route
change event, but we are interested only in those that occur before the user
was redirected so we can check if is authenticated: <b>‘</b></span><b><span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;">$routeChangeStart</span></b><b><span style="font-family: "Verdana","sans-serif";">’</span></b><span style="font-family: "Verdana","sans-serif";">, <b>‘</b></span><b><span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;">$locationChangeStart</span></b><b><span style="font-family: "Verdana","sans-serif";">’</span></b><span style="font-family: "Verdana","sans-serif";">. Here we can check if the route
that the user is going to allows anonymous access and if the user is logged in.
If the case of failure, we can display an error message and redirect the user
to the login page.<o:p></o:p></span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana","sans-serif";"><br /></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">// in
RootController.js<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">myApp.controller('RootController',<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> function
($scope, $route, $routeParams, $location, $rootScope, authenticationService, userService,
toaster) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$scope.user = userService.user;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$scope.$on('$routeChangeStart', function (e, next, current) { <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> if
(next.access != undefined && !next.access.allowAnonymous &&
!$scope.user.isLogged) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$location.path("/Login"); <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
});</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$scope.logout = function () {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
authenticationService.logout()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
.success(function (response) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
userService.reset(); <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
toaster.pop("info", 'You are logged out.', '');<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
});<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
};<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> $rootScope.$on("$locationChangeStart",
function (event, next, current) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> for (var i
in window.routes) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> if
(next.indexOf(i) != -1) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> if
(!window.routes[i].access.allowAnonymous && !userService.user.isLogged)
{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
toaster.pop("error", 'You are not logged in!', '');<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$location.path("/Login");
<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
});<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;"><span style="color: #444444;"> });<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: #444444;"><br /></span></div>
<div style="border-bottom: solid #90C226 1.0pt; border: none; mso-border-bottom-alt: solid #90C226 .5pt; mso-border-bottom-themecolor: accent1; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;"><br /></span></span></span></h1>
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;">Authentication Service</span></span></span></h1>
</div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">This
service provides a way of communicating with the server and sets up the login
status. We are interested in login/logout methods for the moment. On the
back-end it is used a Web API service. <o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">The login
method is a post request sending the ‘login’ data consisting of the username
and password. Notice also the ‘RequestVerificationToken’ that is used to avoid cross-site
request forgery attacks.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #444444;">//in AuthenticationService.js<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;">myApp.factory('authenticationService',</span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> function
($http, $log, $location) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
return {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
login: function (login, antiForgeryToken) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> return $http({<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
method: 'POST',<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
url: '/api/Account/AuthenticateUser',<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
data: login,<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
headers: { 'RequestVerificationToken': antiForgeryToken }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
});<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> },<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
logout: function () {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
return $http.post('/api/Account/Logout');<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> };<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;"><span style="color: #444444;"> });<o:p></o:p></span></span><br />
<span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;"><span style="color: #444444;"><br /></span></span></div>
<div class="MsoNormal">
<br /></div>
<div style="border-bottom: solid #90C226 1.0pt; border: none; mso-border-bottom-alt: solid #90C226 .5pt; mso-border-bottom-themecolor: accent1; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<h1>
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;"><span style="font-size: large;">Putting up all together </span><o:p></o:p></span></span></h1>
</div>
<div class="MsoNormal">
<span style="color: #444444; font-family: Verdana, sans-serif;">The only
thing that remains is to create a view to collect login information and a
controller where we can use the authentication service and the user service
together.</span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">A very
simple login form would look like the example below. We have three input fields
wrapped up in a form. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #444444;">//in Login.cshtml<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">@model Model.LoginModel<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">@{ Layout = null; }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">@functions {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> private
String GetAntiForgeryToken()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> string
cookieToken, formToken;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
AntiForgery.GetTokens(null, out cookieToken, out formToken);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> return
cookieToken + ":" + formToken;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"><div class="container"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> <form
name="loginForm" class="form-signin"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<input id="antiForgeryToken" <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
data-ng-model="antiForgeryToken" <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
data-ng-init="antiForgeryToken='@GetAntiForgeryToken()'"
type="hidden"/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> <h2
class="form-signin-heading">Authentication</h2><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> <br
/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<input type="email" required="required"
name="username" class="form-control"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
ng-model="userData.username" placeholder="Email
address" /><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<input type="password" required name="password"
class="form-control"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
ng-model="userData.password" placeholder="Password"
/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<label class="checkbox"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<input type="checkbox"
value="remember-me">Remember me</label> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
<button type="submit" class="btn btn-lg btn-primary
btn-block" ng-click="login(userData,
loginForm)">Login</button><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> </form><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"></div><o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">When the
user clicks login button, the form data is sent to the account controller.
Using the authentication service, the data is sent in a POST request. In case
of success we use the user service to store the data and redirect the user to the
desired page, otherwise we show an error message and keep the user on the login
page.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">// in
AccountController.js<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">myApp.controller('AccountController',<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> function
AccountController($scope, $cookies, $log, $location, authenticationService,
toaster, userService) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$scope.login = function (userData, loginForm) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> if
(loginForm.$valid) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
authenticationService.login(userData, $scope.antiForgeryToken)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
.success(function (response) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
if (response.status) {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
userService.user.username = response.data.userName;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
userService.user.isLogged = response.data.isLogged;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
toaster.pop('success', 'You are signed in!', '', 2000, true);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$location.path("/MembersPage");<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
} else <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
toaster.pop('error', 'Invalid username or password!', '', 2000, true);}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">}).error(function (data, status, headers, config)
{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;">
$log.info(data);});}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10.5pt;"><span style="color: #444444;"> };<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: Consolas; font-size: 10.5pt; line-height: 110%;"><span style="color: #444444;">});<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="color: #444444;">This is all
it takes to have a rudimentary authentication implementation with AngularJS.</span><o:p></o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com6tag:blogger.com,1999:blog-4622415712118069441.post-81702330652943369732012-05-08T09:55:00.001+03:002012-05-08T09:55:30.206+03:00Your first WCF Service - Step by step<span style="font-family: inherit;"></span><span style="color: #444444;"><span style="font-family: inherit;">Today I'm gonna make a demo for those who want to step into the world of WCF. I'm not going into details about what is </span><a href="http://msdn.microsoft.com/en-us/netframework/dd939784" target="_blank"><span style="font-family: inherit;">WCF</span></a><span style="font-family: inherit;">. In short, it is a platform to build distributed applications using a unified modeling language. </span></span><br />
<br />
<span style="color: #444444; font-family: inherit;"><strong><u>Step 1. Create a new WCF Service Application</u></strong></span><br />
<span style="color: #444444; font-family: inherit;">Open Visual Studio -> File-> New -> Project. Select from the WCF panel a WCF Service Application and give it a name. Mine is called Service1.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: inherit;"></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXUavwXoNLw2akizqVp5hhEwFXCkG1mkC7X8cnG7IIK7ugCNax1TAiYipp4eVe1sbwqDz1cv7zi8KtGD9TpxsIzv5OkjW4xS2yhIZAP4Y8JTAEcweIRfpVGZ95T6fNl2OZa1SHvuxpQKw/s1600/wcf1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="486" mea="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXUavwXoNLw2akizqVp5hhEwFXCkG1mkC7X8cnG7IIK7ugCNax1TAiYipp4eVe1sbwqDz1cv7zi8KtGD9TpxsIzv5OkjW4xS2yhIZAP4Y8JTAEcweIRfpVGZ95T6fNl2OZa1SHvuxpQKw/s640/wcf1.png" width="640" /></span></a></div>
<br />
<span style="color: #444444; font-family: inherit;"><strong><u>Step 2. Configure the service using the confiugration file</u></strong></span><br />
<span style="color: #444444; font-family: inherit;">In the newly created project double click the Web.config file. Here we will have to add a service element an endpoint element and a binding. This step is not mandatory because Wcf creates by default an endpoint and a service, but for the sake of this exercise I will create new elements. </span><br />
<br />
<span style="font-family: inherit;"><span style="color: #444444;"><strong><u>The Binding</u> - </strong>this is where we specify what protocol do we use (http, tcp, etc.), how our data is formatted, what security do we use for sending the message and other things. </span><span style="color: #444444;">So first we create a bindings element where we will use a <strong>wsHttpBinding </strong>like so:</span></span><br />
<span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="font-family: inherit;"><span style="color: red;"><bindings></span><br /><span style="color: red;"><wsHttpBinding></span><br /><span style="color: red;"><binding name<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"MyBinding"</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="color: red;">></span></span></span></span></span></span></span></span></span><br />
<span style="font-family: inherit;"><span style="color: red;"><security mode<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"None"</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">></span></span></span></span><br /><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="color: red;"></security></span></span></span></span></span><br />
<span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: red;"><span style="font-family: inherit;"></binding> <br /><span style="color: red;"></wsHttpBinding></span><br /><span style="color: red;"></bindings></span></span></span></span></span></span><br />
<br />
<span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #444444;"><span style="font-family: inherit;"><strong><u>The Service</u></strong> - here we add our endpoints and configure the service behavior if we have one</span></span><br /><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: red; font-family: inherit;"><services></span><br /><span style="color: red; font-family: inherit;"><service </span><br /><span style="color: red; font-family: inherit;"></span><br /><span style="color: red; font-family: inherit;"></service></span><br /><span style="color: red; font-family: inherit;"></services></span><br /><br /><span style="font-family: inherit;"><span style="color: #444444;"><strong><u>The EndPoints</u></strong> - The endpoint is a structure where we have to specify the Address, Binding and Contract.</span></span><br /><span style="color: #444444; font-family: inherit;">Address - the location (url) where we find the endpoint</span><br /><span style="color: #444444;">Binding - the protocol and other settings that are used to transport data</span><br /><span style="color: #444444;">Contract - the interface (set of operations) that is exposed through this endpoint.</span><br /><span style="color: #444444;">Inside the <service> tag add the definition of the endpoint:</span><br /><span style="font-family: inherit;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: red;"><service name<span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"WcfServiceBlog.Service1"</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="color: red;">></span></span></span></span></span><br /><span style="color: red;"><endpoint <span style="color: red;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">address</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">""</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"> </span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">binding</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"wsHttpBinding"</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"> </span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">bindingConfiguration</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"MyBinding"</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"> </span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">contract</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">=</span></span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;">"WcfServiceBlog.IService1"</span></span></span></span><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: red;">></span></span></span></span></span><br /><span style="color: red;"></service></span></span></span></span><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: red;"></endpoint></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: #efef8f; font-size: small;"><span style="color: black;">Our service is ready.</span><br /><br /><strong><u><span style="color: #444444;">Step 3. Create a client that consumes the service</span></u></strong><br /><span style="color: #444444;">Create a new console application. Expand the project, Right click on References -> Add Service Reference</span><br /><span style="color: #444444;">A popup should appear where you have to enter the url of the service. Because the service is in the same solution you can click the Discover button.</span></span></span></span><span style="font-family: inherit;"><span style="color: red;"></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ17e0NQGcWjfreFXCaKn9MGHQwutQLHYYJo1UXuS9OZpvzlq36jbSlbefBq1_XAaJ_iqwmmL6E75fSLJlSStJRVeL1-3Ev8n0ZZn83FIOqTAw0fp_9oSRSgCLDvetmwNCjVfc6SM1GMQ/s1600/wcf1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" mea="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ17e0NQGcWjfreFXCaKn9MGHQwutQLHYYJo1UXuS9OZpvzlq36jbSlbefBq1_XAaJ_iqwmmL6E75fSLJlSStJRVeL1-3Ev8n0ZZn83FIOqTAw0fp_9oSRSgCLDvetmwNCjVfc6SM1GMQ/s640/wcf1.png" width="640" /></a></div>
<span style="color: #444444;">After your service is discovered, select it and click Ok. In thi moment the tools of visual studio would create the necessary proxy classes so that we can use the service.</span><br /><span style="color: #444444;">In the Main program write the following code:</span><br />
<span style="font-family: inherit;"><span style="color: red;">static void Main(string[] args)</span><br /><span style="color: red;">{</span><br /><span style="color: red;">using (ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client())</span><br /><span style="color: red;">{</span><br /><span style="color: red;">Console.WriteLine(proxy.GetData(10));</span><br /><span style="color: red;">}</span><br /><span style="color: red;">Console.ReadLine();</span><br /><span style="color: red;">}</span></span><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><br /><span style="color: #444444;">Set your client application as a startup project. Right click on project -> Set as startup project.</span><br /><span style="color: #444444;">Run your first wcf service application! :)</span></span></span></span>Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com0tag:blogger.com,1999:blog-4622415712118069441.post-40819619513711501242012-02-24T11:29:00.000+02:002012-02-24T11:29:03.981+02:00WCF NetTcp in IIS<span style="font-family: Verdana, sans-serif;"> </span><span style="color: #444444; font-family: Verdana, sans-serif;">Today I will make a short demo about hosting wcf services with nettcpbinding in iis. </span><br />
<span style="color: #444444; font-family: Verdana, sans-serif;">There are cases when is more suited for your service to use a nettcpbinding for different reasons: speed, reliability, etc.</span><br />
<span style="color: #444444; font-family: Verdana, sans-serif;">But in this case you are limitted to choose the hosts of your service from console app, windows service. So what if you want to host your service in iis and still expose nettcpbindings ? </span><br />
<br />
<span style="color: #444444;"><span style="font-family: Verdana, sans-serif;">So here are a few stept that must be done before we can use our service. For a more in-depth description check this post </span><a href="http://msdn.microsoft.com/en-us/magazine/cc163357.aspx#S1" target="_blank"><span style="font-family: Verdana, sans-serif;">IIS 7.0 and WAS</span></a></span><br />
<br />
<strong><span style="color: #444444; font-family: Verdana, sans-serif; font-size: large;">Step 1. Enable Non-Http protocols</span></strong><br />
<span style="color: #444444; font-family: Verdana, sans-serif; font-size: small;">Go to Control Panel->Programs->Turn Windows features on/off and under .NetFramework 3.5.1 be sure to tick "Non-Http activation" (remember that iis supports only http)</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpKaY2UbEhLCsDkxU5yAf8tPjXeMXRBQNEdl31g2pG-JCrOZmMQCDNDgn2FpCqmU3b3qR5QUWmuKbBrJltsLHSWc4-l1juoS0FE8UibHBOlgtFTHN16SvmJQRMxRkGZIZovz5U8okuXs/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Verdana, sans-serif;"><img border="0" height="382" lda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpKaY2UbEhLCsDkxU5yAf8tPjXeMXRBQNEdl31g2pG-JCrOZmMQCDNDgn2FpCqmU3b3qR5QUWmuKbBrJltsLHSWc4-l1juoS0FE8UibHBOlgtFTHN16SvmJQRMxRkGZIZovz5U8okuXs/s400/5.png" width="400" /></span></a></div>
<br />
<span style="color: #444444;"><strong><span style="font-family: Verdana, sans-serif; font-size: large;">Step 2. Enable WAS and PortSharing.</span></strong></span><br />
<span style="color: #444444; font-family: Verdana, sans-serif;">The previous step will make available some services (wcf services by the way) that will help us. So go now in your services list: Task Manager->Services tab and be sure that the following services are <strong>running</strong>:</span><br />
<br />
<span style="color: #444444;"><span style="font-family: Verdana, sans-serif;"><strong>WAS</strong> - is the Windows process activation service</span></span><br />
<span style="color: #444444;"><div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;"><span class="ArticleInlineTitle"><strong>NetTcpPortSharing</strong> - </span>is the WCF TCP port sharing service. It implements a centralized TCP listener so that multiple processes can listen on the same TCP port. This service is available even if IIS 7.0 is not installed.</span></div>
</span><span style="color: #444444;"><div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;"><span class="ArticleInlineTitle"><strong>NetTcpActivator -</strong> </span>is the WCF TCP Activation Service. It communicates TCP activation requests to WAS.</span></div>
<div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;"> </span></div>
<div class="ArticleNormalPara">
<span style="color: #444444;"><strong><span style="font-family: Verdana, sans-serif; font-size: large;">Step 3. Create a WCF Service with a NetTcpBinding and create the endpoints.</span></strong></span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Create the binding in the bindings tag, and then create 2 endpoints. One for your contract and one mex.</span></div>
<div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;"><strong>Note:</strong> If you don't create the mex endpoint, you won't be able to add a reference in your project.</span></div>
<div class="ArticleNormalPara">
<span style="font-family: Verdana;"></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNDDXIqwFFa3Os-K-aeU4q15epfJj3X9kKs6MEdtvNGdzvICh_3bZ_zI5WCR3MmRfVJku3zFCLQ_wmOkaLv8RnC2Q8qdqguyOyuAmWHJLdZdhwW4L_1S10orgujevFKyfdiEbPRWg80kY/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" lda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNDDXIqwFFa3Os-K-aeU4q15epfJj3X9kKs6MEdtvNGdzvICh_3bZ_zI5WCR3MmRfVJku3zFCLQ_wmOkaLv8RnC2Q8qdqguyOyuAmWHJLdZdhwW4L_1S10orgujevFKyfdiEbPRWg80kY/s640/6.png" width="640" /></a></div>
<div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;"></span> </div>
<div class="ArticleNormalPara">
<span style="color: #444444;"><strong><span style="font-family: Verdana, sans-serif; font-size: large;">Step 4. Publish the service in iis and configure it</span></strong></span><br />
<br />
<span style="font-family: Verdana, sans-serif;">Right click on the service->Publish. Be sure to tick 'Mark as IIS application'</span></div>
<div class="ArticleNormalPara">
<span style="font-family: Verdana, sans-serif;">In IIS, expand your newly created application, go in content view and browse your service. You will get this error:</span></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana;"></span> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8WXwx3_ym94uwU79DNv4eFDRSkoiCoOaRvq-YckgOivf69jR9jW5ygDN0UXBVLnKX0IHh6-7YsRj6oga25ue9BOAmdQqmL3gts5x0qzf1UzQ0zTzf5lNBGnk53ND4bcU2QhlRbnV-Lr0/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="252" lda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8WXwx3_ym94uwU79DNv4eFDRSkoiCoOaRvq-YckgOivf69jR9jW5ygDN0UXBVLnKX0IHh6-7YsRj6oga25ue9BOAmdQqmL3gts5x0qzf1UzQ0zTzf5lNBGnk53ND4bcU2QhlRbnV-Lr0/s640/7.png" width="640" /></a></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana, sans-serif;">This tells us that currently we don't have support for tcp protocol so here is what you have to do in order to eneable it: in iis, right click on application->Manage Application->Advanced Settings and add "net.tcp" next to http and then click ok.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR0U5k2jhLRcJZrMdr3GsEQhWgAIfmVEjyodywFdt07erc5aIJbuuZOMqVFvXBr5_KHvc9DA9r-1gOJeGeD24h4ldCtPJAcBtoGymRc0T1ff4eGM7ahG38MeHfPOiXezLTHg87S3Lra44/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="574" lda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR0U5k2jhLRcJZrMdr3GsEQhWgAIfmVEjyodywFdt07erc5aIJbuuZOMqVFvXBr5_KHvc9DA9r-1gOJeGeD24h4ldCtPJAcBtoGymRc0T1ff4eGM7ahG38MeHfPOiXezLTHg87S3Lra44/s640/8.png" width="640" /></a></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana, sans-serif;"> Now the error should be gone</span></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana;"></span> </div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana;"><span style="color: #444444;"><strong><span style="font-family: Verdana, sans-serif; font-size: large;">Step 5. Add a reference to your project</span></strong></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieN_hnysUC1TAiIpVcB9dsQnBkeZktn5GbAkYolbs_QPHAM_8zeS22q9tMt6OWPSnRbPbibXeJOaAaCYeQx_32iENQhsX8yvq-B8tn0C8PGCo2MZG0cLczMXB1kKZioJX-AY10qEs7nhI/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="322" lda="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieN_hnysUC1TAiIpVcB9dsQnBkeZktn5GbAkYolbs_QPHAM_8zeS22q9tMt6OWPSnRbPbibXeJOaAaCYeQx_32iENQhsX8yvq-B8tn0C8PGCo2MZG0cLczMXB1kKZioJX-AY10qEs7nhI/s640/9.png" width="640" /></a></div>
</span></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana;">And that's it :).</span></div>
<div class="ArticleNormalPara" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<span style="font-family: Verdana, sans-serif;"><a href="https://skydrive.live.com/redir.aspx?cid=a10f0f7bf1b982fc&resid=A10F0F7BF1B982FC!130&parid=A10F0F7BF1B982FC!129&authkey=!AAnp7vAdwIjXlVA" target="_blank">Download code</a></span></div>
</span>Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com4tag:blogger.com,1999:blog-4622415712118069441.post-60922745146558696042011-12-15T13:01:00.000+02:002011-12-15T21:11:38.457+02:00Working with EndPoint Behavior in WCF<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Today I will make a short demo about how you can extend your Wcf service with custom behaviors. Wcf provides many ways of customizing the runtime behavior of your service. For a more detailed explanation please refer to </span></span><span style="color: #444444;"><a href="http://msdn.microsoft.com/en-us/magazine/cc163302.aspx" target="_blank"><span style="font-family: "Verdana", sans-serif;">msdn magazine</span></a></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> .</span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br />
</span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">First of all, let's find out who the players are. We will be working in the 'ServiceModelLayer' with the 'Dispatcher' in the context of the service host and the 'Proxy' in the context of a client. Their job is to translate between </span><b><span style="font-family: "Verdana", sans-serif;">WCF Message Objects and </span></b></span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">.Net Method Calls.</span></b></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span> </span><span style="color: #444444;"><b><br />
</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja-mvfSlN62PYvim9kcHfe9SNd7JI2BPALDZFcrnpzAWN8FWvCk5eQ1BZoh0GLjyy_f79zEicsP5Y2AVipoyvJvNzOAGnH0IIc-xul8HH7g4YEXBfcD55dypMTLQ-4JwLAxwIaNNQ9TQ8/s1600/cc163302.fig01%2528en-us%2529.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja-mvfSlN62PYvim9kcHfe9SNd7JI2BPALDZFcrnpzAWN8FWvCk5eQ1BZoh0GLjyy_f79zEicsP5Y2AVipoyvJvNzOAGnH0IIc-xul8HH7g4YEXBfcD55dypMTLQ-4JwLAxwIaNNQ9TQ8/s320/cc163302.fig01%2528en-us%2529.gif" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #444444;">WCF runtime</span> </div>
<span style="color: #444444;"><br />
</span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">This pair dispatcher/proxy follow a sequence of steps during which you can insert your own code for message transformation, serialization, parameters inspection and so on.</span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br />
</span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Here is a list of 'points' where you can plug in and insert your code by implementing the following interfaces.</span></span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;"><br />
</span></b></span><br />
<div style="display: block;">
<span style="color: #444444;"> </span><span style="color: #444444;"> </span><br />
<table><tbody>
<tr> <th><span style="color: #444444;">Stage</span></th><th><span style="color: #444444;">Interceptor Interface</span></th><th><span style="color: #444444;">Description</span></th> </tr>
<tr> <td valign="top"><span style="color: #444444;">Parameter</span> <span style="color: #444444;">Inspection</span></td> <td valign="top"><span style="color: #444444;">IParameterInspector</span></td> <td valign="top"><span style="color: #444444;">Called before and after invocation to </span><br />
<span style="color: #444444;">inspect and modify parameter values.</span></td> </tr>
<tr> <td valign="top"><span style="color: #444444;">Message Formatting</span></td> <td valign="top"><span style="color: #444444;">IDispatchMessageFormatter</span><br />
<span style="color: #444444;">IClientFormatter</span></td> <td valign="top"><span style="color: #444444;">Called to perform serialization and </span><br />
<span style="color: #444444;">deserialization.</span></td> </tr>
<tr> <td valign="top"><span style="color: #444444;">Message Inspection</span></td> <td valign="top"><span style="color: #444444;">IDispatchMessageInspector</span><br />
<span style="color: #444444;">IClientMessageInspector</span></td> <td valign="top"><span style="color: #444444;">Called before send or after receive to</span><br />
<span style="color: #444444;">inspect and replace message contents.</span></td> </tr>
<tr> <td valign="top"><span style="color: #444444;">Operation Selection</span></td> <td valign="top"><span style="color: #444444;">IDispatchOperationSelector</span><br />
<span style="color: #444444;">IClientOperationSelector</span></td> <td valign="top"><span style="color: #444444;">Called to select the operation to invoke for the given message.</span></td> </tr>
<tr> <td valign="top"><span style="color: #444444;">Operation Invoker</span></td> <td valign="top"><span style="color: #444444;">IOperationInvoker</span></td> <td valign="top"><span style="color: #444444;">Called to invoke the operation.</span></td> </tr>
</tbody></table>
</div>
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">So now we know what kind of extensions we have and whom they apply to. In order to apply an extension (from the above list) </span><b><span style="font-family: "Verdana", sans-serif;">we need to set up a behavior</span></b><span style="font-family: "Verdana", sans-serif;">. There are 4 types of behaviors in wcf, each of them sharing this set of methods:</span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span><b><span style="font-family: "Verdana", sans-serif;">Validate</span></b><span style="font-family: "Verdana", sans-serif;"> - Called just before the runtime is built—allows you to perform custom validation on the service description.</span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span><b><span style="font-family: "Verdana", sans-serif;">AddBindingParameters</span></b><span style="font-family: "Verdana", sans-serif;"> - Called in the first step of building the runtime, before the underlying channel is constructed—allows you to add parameters to influence the underlying channel stack.</span><span style="font-family: "Verdana", sans-serif;"><br /></span><b><span style="font-family: "Verdana", sans-serif;">ApplyClientBehavior</span></b><span style="font-family: "Verdana", sans-serif;"> - Allows behavior to inject proxy (client) extensions. Note that this method is not present on IServiceBehavior.</span><span style="font-family: "Verdana", sans-serif;"><br /></span><b><span style="font-family: "Verdana", sans-serif;">ApplyDispatchBehavior</span></b><span style="font-family: "Verdana", sans-serif;"> - Allows behavior to inject dispatcher extensions.</span><span style="font-family: "Verdana", sans-serif;"><br /></span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">One exception is that IServiceBehavior doesn't have an ApplyClientBehavior method because service behaviors can't be applied to clients.</span><span style="font-family: "Verdana", sans-serif;"><br /></span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><b>Types of Behaviors</b></span></span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;"><br />
</span></b></span><br />
<div style="display: block;">
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><br />
<table><tbody>
<tr><th></th><th></th><th></th></tr>
<tr><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Scope</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Interface</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Potential Impact</span></span></td></tr>
<tr><td valign="top"></td><td valign="top"></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Service</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Endpoint</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Contract</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Operation</span></span></td></tr>
<tr><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Service</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">IServiceBehavior</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td></tr>
<tr><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Endpoint</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">IEndpointBehavior</span></span></td><td valign="top"></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td></tr>
<tr><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Contract</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">IContractBehavior</span></span></td><td valign="top"></td><td valign="top"></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td></tr>
<tr><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Operation</span></span></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">IOperationBehavior</span></span></td><td valign="top"></td><td valign="top"></td><td valign="top"></td><td valign="top"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">✗</span></span></td></tr>
</tbody></table>
<span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Let's see now how the behavior and the extension get together.</span></span></span><span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span></span></span><br />
<span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">My example comes from a silverlight application where I had to create a custom behavior in order to catch wcf exceptions. So to achieve this I used </span></span></span><span style="font-family: "Verdana", sans-serif;">
</span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">IDispatchMessageInspector </span></b></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">to change the status code of the reply to 200 (OK) and the</span></span><span style="font-family: "Verdana", sans-serif;">
</span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">IEndpointBehavior </span></b></span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">because I wanted to apply this extension only to this level.</span></span><span style="font-family: "Verdana", sans-serif;">
</span><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"> </span></span><span style="font-family: "Verdana", sans-serif;">
</span><span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span></span></span><br />
<span style="font-family: "Verdana", sans-serif;">
</span><span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Show me some code! :)</span></span></span><span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><br /></span></span></span><br />
<span style="color: #444444;"><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">Step 1. Create the extension implementing </span></b></span></span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">IDispatchMessageInspector</span></b></span>
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><br /></span></span></span></span><br />
<span style="font-size: small;"><span style="font-family: inherit;"><span style="color: #444444;">public class SilverlightFaultMessageInspector : IDispatchMessageInspector<br /> {<br /> #region IDispatchMessageInspector Members<br /><br /> public object AfterReceiveRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel, System.ServiceModel.InstanceContext instanceContext)<br /> {<br /> // Do nothing<br /> return null;<br /> }<br /><br /> public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, object correlationState)<br /> {<br /> if (reply.IsFault)<br /> {<br /> HttpResponseMessageProperty property = new HttpResponseMessageProperty();<br /> // Here the response code is changed to 200.<br /> property.StatusCode = System.Net.HttpStatusCode.OK;<br /> reply.Properties[HttpResponseMessageProperty.Name] = property;<br /> }<br /> }<br /> #endregion<br /> }</span></span></span><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;"><br /></span></b></span><br />
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><b>Step 2. Create the behavior and apply the entension</b></span></span></span></span><br />
<span style="font-size: small;"><span style="font-family: inherit;"><span style="color: #444444;"><span style="color: #444444;">public class FaultBehavior : BehaviorExtensionElement, IEndpointBehavior<br /> {<br /> #region IEndpointBehavior Members<br /> public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)<br /> {<br /> }<br /><br /> public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)<br /> { <br /> }<br /><br /> </span></span></span></span><b><span style="font-size: small;"><span style="font-family: inherit;"><span style="color: #444444;"><span style="color: #444444;">public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)<br /> {<br /> SilverlightFaultMessageInspector inspector = new SilverlightFaultMessageInspector();<br /> endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);<br /> }</span></span></span></span></b><span style="font-size: small;"><span style="font-family: inherit;"><span style="color: #444444;"><span style="color: #444444;"><br /><br /> public void Validate(ServiceEndpoint endpoint)<br /> {<br />}<br /> public override Type BehaviorType<br /> {<br /> get { return typeof(FaultBehavior); }<br /> }<br /><br /> protected override object CreateBehavior()<br /> {<br /> return new FaultBehavior();<br /> }<br /> #endregion<br /> }</span></span></span></span><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><b><br /></b></span></span></span></span><br />
<span style="font-size: small;"><span style="color: #444444;"><span style="color: #444444;"><b><span style="font-family: "Verdana", sans-serif;">Step 3. Declare the behavior extension in the service config file</span></b><span style="font-family: "Verdana", sans-serif;"><br /></span></span></span></span><br />
<span style="font-size: small;"><span style="color: #444444;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">Inside the <system.serviceModel> create the <extensions> element if does not exist.</span></span></span></span><span style="font-size: small;"><span style="font-family: inherit;"><span style="color: #444444;"><span style="color: #444444;"><b><br /></b></span></span></span></span><br />
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><extensions><br /> <behaviorExtensions><br /> <add name="silverlightFaults" type="myservicename.FaultBehavior, myservicename, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /><br /> </behaviorExtensions><br /> </extensions></span></span></span></span><br />
<i><b><span style="color: red;"><span style="font-family: "Verdana", sans-serif;">NOTE: the type must be the fully qualified name of the assembly/class that you are using and must be declared on a single line, otherwise will not work (WCF known issue)</span></span></b></i><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><br />
</span></span><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"> </span></span><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><br />
</span></span></span></span></div>
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;"><b>Step 4. Create an end point behavior and add the extension</b></span></span><br />
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"> <behavior name="myFaultBehavior"><br /> <silverlightFaults /><br /> </behavior><br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd-ok_uOnOsOd8qs__G8VZ-icmj4Qiz_lpTb60E9JyVKquSUnHMsB_S1PQnpZkjSlspDyymMXDTSLdQjfkMPAjhjOs6nPwWWrIju3fxUKXMroyQfrAHbCP3wBbrrMh7uHM32Y2iZwoMYg/s1600/behaviorsinwcf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="580" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd-ok_uOnOsOd8qs__G8VZ-icmj4Qiz_lpTb60E9JyVKquSUnHMsB_S1PQnpZkjSlspDyymMXDTSLdQjfkMPAjhjOs6nPwWWrIju3fxUKXMroyQfrAHbCP3wBbrrMh7uHM32Y2iZwoMYg/s640/behaviorsinwcf.png" width="640" /></a></div>
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><b>Step 5. Crate an endpoint and assign behavior configuration attribute</b><br />
</span></span><br />
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><endpoint address=""<br /> binding="basicHttpBinding" <br /> bindingConfiguration="MyHttpBinding" <br /> contract="IMyContract"<br /> behaviorConfiguration="myFaultBehavior"></span></span><br />
<span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"></endpoint><br />
</span></span><br />
<span style="color: #444444;"><span style="font-family: "Verdana", sans-serif;">And that's it! You can inspect the exceptions that come from a wcf service by using e.Error property in the completed event handler. </span></span><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><br /></span></span>Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com0tag:blogger.com,1999:blog-4622415712118069441.post-35447116681577412432011-12-09T13:45:00.001+02:002011-12-15T11:16:25.387+02:00Streaming in WCF<br />
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">There are scenarios when you must be able to send or receive large amount of data or files using a service in your application. WCF supports streaming and I will show you how to achieve that.</span></span></div>
<div style="color: #444444;">
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: small;">There are 4 types of TransferMode in WCF</span></div>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: x-small;"><span style="color: blue; font-size: 10pt;">using</span><span style="font-size: 10pt;"> System;</span><span style="color: blue; font-size: 10pt;">namespace</span><span style="font-size: 10pt;"> System.ServiceModel<br />{<br /> <span style="color: blue;">public</span> <span style="color: blue;">enum</span> <span style="color: #2b91af;">TransferMode</span> </span></span><br />
<span style="font-size: x-small;"><span style="font-size: 10pt;"> {<br /> Buffered = 0,<br /> Streamed = 1,<br /> StreamedRequest = 2,<br /> StreamedResponse = 3,<br /> }<br />}</span><span style="font-size: x-small;"><br /></span></span></div>
<br />
<span style="font-family: "Verdana", sans-serif; font-size: small;">The default one is Buffered. This means that the sender/receiver cannot process the message until the whole data is in one place.</span> <span style="font-family: "Verdana", sans-serif;">We must set our binding to <b>Streamed </b>to enable streaming.</span><br />
<br />
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: small;">Next thing is to add an operation contract that <b>must </b>satisfy 2 conditions:</span></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: small;">1. The parameter that holds the data to be streamed must be the only parameter in the method.</span></div>
<span style="font-family: "Verdana", sans-serif; font-size: small;">2. </span><span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;">At least one of the types of the parameter and return value must be either </span><a href="http://msdn.microsoft.com/en-us/library/system.io.stream.aspx" style="font-family: Verdana,sans-serif;">Stream</a><span style="font-family: "Verdana", sans-serif;">, </span><a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.message.aspx" style="font-family: Verdana,sans-serif;">Message</a><span style="font-family: "Verdana", sans-serif;">, or </span><a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx" style="font-family: Verdana,sans-serif;">IXmlSerializable</a><span style="font-family: "Verdana", sans-serif;">. </span></span><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;"> </span></span><br />
<br />
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">In short, this means that the method must have only one parameter which is a Stream, otherwise the return type must be Stream,Message, etc...</span> </span><br />
<br /></div>
<div style="color: #444444;">
<b><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">Step 1. Create a WCF service application</span></span></b></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">In VisualStudio, File->New Project->Wcf->Wcf Service Application</span></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<b><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">Step 2. Add an operation contract with a Stream parameter</span></span></b></div>
<div style="color: #444444;">
<span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;">Here is my service contract:</span></span></div>
<div style="color: #444444;">
</div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">[ServiceContract]</span></span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">public interface IService1</span></span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">{<br /> [OperationContract]<br /> bool SendStream(Stream stream);</span></span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">}</span></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<b><span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;">Step 3. Create a binding in the configuration file, which supports streaming</span></span></b></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif; font-size: small;">We have to <b>set the transferMode to Streamed</b> and increase the message size attributes.</span><span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;"> I have used a regular basicHttpBinding.</span></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-size: x-small;"><span style="font-family: "Verdana", sans-serif;"><bindings></span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> <basicHttpBinding></span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> <binding name="streaming" maxReceivedMessageSize="67108864" transferMode="Streamed"> </span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> </binding></span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> </basicHttpBinding></span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> </bindings></span></span></div>
<div style="color: #444444;">
<br /></div>
<div class="separator" style="clear: both; color: #444444; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-j_xIPonH5tLlXy8j8w29vIClt5cs1cfDEZYrHjUGHyFwRTeVm8It3Sx5Wrbn4rhBnoY41ITHqpfVL3v8pHGT1EJggzrRPtH9SpajDv7djcztitV7N2DsfOBzhHZkjEQZO8tSNpSpfM/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="492" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-j_xIPonH5tLlXy8j8w29vIClt5cs1cfDEZYrHjUGHyFwRTeVm8It3Sx5Wrbn4rhBnoY41ITHqpfVL3v8pHGT1EJggzrRPtH9SpajDv7djcztitV7N2DsfOBzhHZkjEQZO8tSNpSpfM/s640/2.png" width="640" /></a></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif; font-size: small;">After the binding is created, add the endpoint and service tags like in the image above.</span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-size: small;"><b style="font-family: Verdana,sans-serif;">Step 4. Implement the operation contract in Service.svc</b></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: x-small;"><span style="font-family: "Verdana", sans-serif;">public bool SendStream(Stream stream)</span><span style="font-family: "Verdana", sans-serif;"> </span></span></span></span></div>
<div style="color: #444444;">
<span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: x-small;"><span style="font-family: "Verdana", sans-serif;">{</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> try</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> {</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> using (FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "file", FileMode.Create))</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> {</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> stream.CopyTo(fs);</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> }</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> return true;</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> }</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> catch (Exception ex)</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> {</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> return false;</span><br style="font-family: Verdana,sans-serif;" /><span style="font-family: "Verdana", sans-serif;"> }</span><span style="font-family: "Verdana", sans-serif;"> </span></span></span></span></div>
<div style="color: #444444;">
<span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: x-small;"><span style="font-family: "Verdana", sans-serif;">}</span></span></span><b style="font-family: Verdana,sans-serif;"><br /></b></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444; font-family: Verdana,sans-serif;">
<span style="font-size: small;"><b>Step 5. Critical step. </b></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-size: small;"><span style="font-family: "Verdana", sans-serif;"> I lost many hours trying to understand why this almost complete configuration doesn't work with files larger than 3-4 MBytes.</span></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444; font-family: Verdana,sans-serif;">
<span style="font-size: small;">The reason is that even if we enable streaming and we increase the message size, ASP.NET doesn't know about WCF limitations. So the solution is to add httpRuntime in system.web element:</span></div>
<div style="color: red;">
<httpRuntime maxRequestLength="67108864"/></div>
<div style="color: red;">
<br /></div>
<div style="color: red;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9CWtsjWZavns0OILJXxFi0y-eIKekKdASxqTf2lWIpH3uEgJB9SqvURvxR-488nhO_tNPOdn6hZ4o1WyBEperTbs9-3f-C_paDnzpD57f8UT2QpwTD3F_X93aZkSGxBDp7_FxOIn6Uw8/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="492" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9CWtsjWZavns0OILJXxFi0y-eIKekKdASxqTf2lWIpH3uEgJB9SqvURvxR-488nhO_tNPOdn6hZ4o1WyBEperTbs9-3f-C_paDnzpD57f8UT2QpwTD3F_X93aZkSGxBDp7_FxOIn6Uw8/s640/3.png" width="640" /></a><span style="color: #444444;"></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-size: small;"><b style="font-family: Verdana,sans-serif;">Step 6. Create the client and consume the service</b></span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;">Create a simple console application and add a service reference of the created service. You must have a file called 'largefile' without any extension in the bin\debug\ folder of your console application. Mine has ~20 MBytes.</span></div>
<div style="color: #444444;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTaMcC36dnPG10g_gFGkPBCO3BeAYUnRew42_4WtMp75jKviB1r4BvUTp2KmrAWRU1DmDgEBEo9BqFMFWblmXf6JTK7yo7I8OYvggwr_tpXfX4du2hysVZu7dS4XRFtEcWuuG9hY6Xxuk/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="588" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTaMcC36dnPG10g_gFGkPBCO3BeAYUnRew42_4WtMp75jKviB1r4BvUTp2KmrAWRU1DmDgEBEo9BqFMFWblmXf6JTK7yo7I8OYvggwr_tpXfX4du2hysVZu7dS4XRFtEcWuuG9hY6Xxuk/s640/4.png" width="640" /></a></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><br /></span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;">Now consume the service:</span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif;"><span style="font-size: x-small;">static void Main(string[] args)<br /> {<br /> try<br /> {<br /> using (ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client())<br /> {<br /> using (FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "largefile", FileMode.Open))<br /> {<br /> var result = proxy.SendStream(fs);<br /> }<br /> }<br /> }<br /> catch (Exception ex)<br /> {<br /> }<br /> }</span></span></div>
<div style="color: #444444;">
<br /></div>
<div style="color: #444444; font-family: Verdana,sans-serif;">
<span style="font-size: small;">The result should be true, which means that the streaming was successful.</span></div>
<div style="color: #444444;">
<span style="font-family: "Verdana", sans-serif; font-size: small;">Happy coding! :)</span><br />
<span style="font-family: "Verdana", sans-serif; font-size: small;"><a href="https://skydrive.live.com/redir.aspx?cid=a10f0f7bf1b982fc&resid=A10F0F7BF1B982FC!127&parid=root" target="_blank">Download code</a></span>
<span style="font-family: "Verdana", sans-serif; font-size: small;"><br /></span></div>Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com4tag:blogger.com,1999:blog-4622415712118069441.post-39299668347852550602011-12-08T09:00:00.001+02:002011-12-15T11:13:21.478+02:00WCF Security overview<span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #999999;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">WCF framework is so huge that yo</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">u can easily get lost. I spent many hours to figure out how it works and I thought that I might share my conclusions.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #999999;"><span style="background-color: #444444;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">There are 2 major types of security modes in WCF and o variation of those two:</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Message level security - the default one</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">-the message is encrypted from end to end</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: #444444;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Transport level security</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div>
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">-the communication channel is encrypted using ssl over http (https)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">TransportWithMessageCredential</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">-it's a variation of the other two types. It provides both channel and message encryption.F</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">or HTTP, the mechanism is Secure Sockets Layer (SSL) over HTTP (HTTPS); </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">for TCP, it is SSL over TCP or Windows.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Here is a </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><a href="http://msdn.microsoft.com/en-us/library/ms734769.aspx" target="_blank"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="background-color: white; color: orange;"> good article </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></a><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">about securing services.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">I will now make few step by step demos of </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">combined security and authentication practices in WCF.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">The firs one is using </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Basic Authentication in WCF</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">using </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><i><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">TransportCredentialOnly</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></i><i><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></i><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">security mode. Note that i</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">t does not provide message integrity or confidentiality. Basic authentication works well in scenarios where you want to provide access to some people inside a company for example.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">In the first part we will create the service with the needed configuration and host it on iis. The next ting we will create a basic(Console) client to consume our service. </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><b><span style="font-size: large;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Part I - Creating the service</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 1. Create a new WCF Service Application</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">I named my "WcfBasic"</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1HgUdFkbuRZsUjsvoOkMUH-IB_jFN-HIY08WYKZzkCmpsyd0HrKn01Fl67wmztRROo6IQtfLrldb8p92BeWgc9jI3NQfWrbCDqxbJLkvzpjy21xybWvzmN_KydY1glxTHhPBUL6NxWhQ/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="440" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1HgUdFkbuRZsUjsvoOkMUH-IB_jFN-HIY08WYKZzkCmpsyd0HrKn01Fl67wmztRROo6IQtfLrldb8p92BeWgc9jI3NQfWrbCDqxbJLkvzpjy21xybWvzmN_KydY1glxTHhPBUL6NxWhQ/s640/1.png" width="640" /></a><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> Step 2. Create a binding</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> I choose to create a basic http binding , nothing very special. Here is the element.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><basicHttpBinding></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> <binding name="SecurityBinding"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> <security mode="TransportCredentialOnly"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> <transport clientCredentialType="Basic"></transport></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </security></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"> </binding></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"> </basicHttpBinding></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: white;"><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Now we have to put this element in the configuration file </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">inside </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> the </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> bindings </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">element.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Note: if you don' have <bindings> element just create it</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vXr8AQ46zEbGJUkXI0iMPhGZPNYCioUhGXV7ZKARF4V9j6-IU07N0qb9LRVgnDcmq8SYJCgKkJEQTp4bOMi-6BSdyyTlsr3Wxru7EaCGdr4okoTaq35WAVBQknr-GLxIUO5HBDrs_dk/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="552" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vXr8AQ46zEbGJUkXI0iMPhGZPNYCioUhGXV7ZKARF4V9j6-IU07N0qb9LRVgnDcmq8SYJCgKkJEQTp4bOMi-6BSdyyTlsr3Wxru7EaCGdr4okoTaq35WAVBQknr-GLxIUO5HBDrs_dk/s640/2.png" width="640" /></a></div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 3. Add the service and end point elements.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">You must add the following element in the <services> tag in the configuration file. If there is no <services> element just create one.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><services></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> <service name="WcfSecurity.SecurityService"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> <endpoint address="" </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> binding="basicHttpBinding" bindingConfiguration="SecurityBinding"</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> name="BasicHttpEndpoint" contract="WcfSecurity.ISecurityService"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </endpoint> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </service></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></b><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </services></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfraxNaUyxZv-fgIyFJ8FJR_Iol3JJjgYoWvF2HYkoJRrW4kD1jFxM8-apg264U-H-THdn1qqrMnhAYpwQcWiJO7tP3DuDCR36jFDlQgz-N55T_GQrCXcCK7Zg7gBGXsn62AfeHw1ZS2k/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="602" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfraxNaUyxZv-fgIyFJ8FJR_Iol3JJjgYoWvF2HYkoJRrW4kD1jFxM8-apg264U-H-THdn1qqrMnhAYpwQcWiJO7tP3DuDCR36jFDlQgz-N55T_GQrCXcCK7Zg7gBGXsn62AfeHw1ZS2k/s640/3.png" width="640" /></a></div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Save now the changes, build your project and let's try to open it in a browser.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Right click on Service1.svc -> View in Browser. You should get this error:</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><i><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Security settings for this service require 'Basic' Authentication but it is not enabled for the IIS application that hosts this service.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></i><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">That's because we haven't enabled yet basic authentication for our service.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 4. Host the service on iis and enable basic authentication</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">First we have to publish the service on iis. For this you have to right click on the WcfBassic project and click Publish</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgORjYeWuQQX_M_42S5jEuYD-WAtXBIpR7_o0yI0QVyAhuOkgJcxX0rr_SdknKyTSpT5cvKh-z6CNuAWKQZN2FrX-0ERJ17Mgaeet4m-fwlz-m5xpR7e6DE3UiJxgxrADQBGxzkxAIeuAU/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="578" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgORjYeWuQQX_M_42S5jEuYD-WAtXBIpR7_o0yI0QVyAhuOkgJcxX0rr_SdknKyTSpT5cvKh-z6CNuAWKQZN2FrX-0ERJ17Mgaeet4m-fwlz-m5xpR7e6DE3UiJxgxrADQBGxzkxAIeuAU/s640/5.png" width="640" /></a></div>
<span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">It will appear a popup where we have to set up the virtual directory and other things.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Service Url: localhost</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Site/application: Default Web Site/WcfBasic (here you can add other name if you like)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Check 'Mark as IIS application on destination'</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Click Publish</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Note: solve and build errors before publishing, otherwise the publish will fail!</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7yVnCdOFx6zAv6j_FVFsmj-NHinkqXKMti8SqdqMbOYHBzlizHAJL9RzEGFjgvfy4fjYn85QuLdGJrq7TfVv3V3J8C419h2Bv1XJhj8Z5HLa4XxLTyg4uxjhRAkUoYf9_IVlD1BmlHHo/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="546" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7yVnCdOFx6zAv6j_FVFsmj-NHinkqXKMti8SqdqMbOYHBzlizHAJL9RzEGFjgvfy4fjYn85QuLdGJrq7TfVv3V3J8C419h2Bv1XJhj8Z5HLa4XxLTyg4uxjhRAkUoYf9_IVlD1BmlHHo/s640/6.png" width="640" /></a></div>
<span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">After the publish is succeeded, open your IIS manager and let's enable the basic authentication. </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 5. Enable basic authentication in iis</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Locate your application under Sites/Default Web Site. In the Features view, locate and double click the Authentication icon.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFuCDJhgvTiPi_ebq8jQ2HJ2GKCCiSdntASbCnSDj1H6MzsSpN6II294cpBZqVyTIfF0PL_BaHR1mtc5t3p0e9s2K0X2qjXrYBoJmMhV_KyKrXeQXBSdym_d7tVAHxwV7KhU9dQLgA17k/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="402" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFuCDJhgvTiPi_ebq8jQ2HJ2GKCCiSdntASbCnSDj1H6MzsSpN6II294cpBZqVyTIfF0PL_BaHR1mtc5t3p0e9s2K0X2qjXrYBoJmMhV_KyKrXeQXBSdym_d7tVAHxwV7KhU9dQLgA17k/s640/7.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">In the screen that will show we have to do 2 things: enable basic authentication, disable any other authentication type. You can use enable/disable button from the right Actions pane. It should look like this.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhOoEVJlseXleFG0VIu8KTvXpb_bBt_qS8rvATwwkrPo7cbGH84MfSAnYynXdWeAdhhhXaZ3ylwFDntAj_hYCrVHJKMV6KbgbhhfE47-kWdednTrYBmaAIp34P3Oawcz26LPvgFVLXT6M/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="410" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhOoEVJlseXleFG0VIu8KTvXpb_bBt_qS8rvATwwkrPo7cbGH84MfSAnYynXdWeAdhhhXaZ3ylwFDntAj_hYCrVHJKMV6KbgbhhfE47-kWdednTrYBmaAIp34P3Oawcz26LPvgFVLXT6M/s640/8.png" width="640" /></a></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Now switch to 'Content View', click on Service1.svc and in the Actions pane click Browse.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGneWCj_iiHKwo-TYcGFU9xWrHtaIt5fyaiTY61Axyiyf3-n6qiPesqmNnQHZ1-cehyAdQFddjbaKZglKAB1kfslE5WlZIC9JH1DudGN98IO6juzT67CBYc-Dp0Z3TE_95PvCoW-Cbbok/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGneWCj_iiHKwo-TYcGFU9xWrHtaIt5fyaiTY61Axyiyf3-n6qiPesqmNnQHZ1-cehyAdQFddjbaKZglKAB1kfslE5WlZIC9JH1DudGN98IO6juzT67CBYc-Dp0Z3TE_95PvCoW-Cbbok/s640/10.png" width="640" /></a></span></div>
<span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">And voilà! You are prompted to enter your credentials. Now you would ask but what credentials? Their are just the ones you use to log on to the machine.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQeNC6T9TTaT4iMAMrF_BaU45ovgy3wiwsQd-8kZhF-HgqKFVicLuUZXUUtm9YlCjBH5lDC0E6CaU1MA1OXwJUKK46wl-YkV8TbmDkUsGQ66w8Mm2DaVsqHr0xQvTq1vElqG9dikXkgoY/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="598" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQeNC6T9TTaT4iMAMrF_BaU45ovgy3wiwsQd-8kZhF-HgqKFVicLuUZXUUtm9YlCjBH5lDC0E6CaU1MA1OXwJUKK46wl-YkV8TbmDkUsGQ66w8Mm2DaVsqHr0xQvTq1vElqG9dikXkgoY/s640/9.png" width="640" /></a></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">If you enter the good credentials you will be directed to the service page.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisepbKFVQ13aN6wGhgguavzQAnWmewDIZjJ4NpKi5wSDHx1RsiIvMXDngCVwV9Gx08DIfpElqja-oYp35KteN6C5kOgqB5OXQnf_E0X89bOHuWv6eDy7ChJswv87fwr1b3XmYcYZD7uKA/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="598" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisepbKFVQ13aN6wGhgguavzQAnWmewDIZjJ4NpKi5wSDHx1RsiIvMXDngCVwV9Gx08DIfpElqja-oYp35KteN6C5kOgqB5OXQnf_E0X89bOHuWv6eDy7ChJswv87fwr1b3XmYcYZD7uKA/s640/11.png" width="640" /></a></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Otherwise you will get unauthorized error.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjre7lqy8UVV7YM_uxb67BiTGqjA4BS6iKZbMbZa_xyrYM146iCrq4K_wnPhbFTUrfPzXoVFXre_DIThVRRwALMpMiySvHv3sRecHa6BoIs-J-24Ivzi3jdf4uy6eiBPek0VEQfry5ZASA/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="594" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjre7lqy8UVV7YM_uxb67BiTGqjA4BS6iKZbMbZa_xyrYM146iCrq4K_wnPhbFTUrfPzXoVFXre_DIThVRRwALMpMiySvHv3sRecHa6BoIs-J-24Ivzi3jdf4uy6eiBPek0VEQfry5ZASA/s640/12.png" width="640" /></a></div>
<span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">That was the hard part. What's left now is to create a client to consume the service.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><b><span style="font-size: large;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Part II. Creating the client to consume the service</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><b><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: #f3f3f3;"><span style="background-color: #f3f3f3;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: black;"><span style="background-color: black;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 1. Create a new console application in the solution</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></b></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiH7jj_fGEgAe679M-6wbOBiKYq_oAoRe551IFxBpE38gnHQbZwCu87zES0MRBuqKFUFSvBJ6m69Uk9DXw6qPTPK12dtz9kAKrkuXrDi53DNnccZZuqOiB13XvM_JIN3X02kgxRuZ7VfI/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiH7jj_fGEgAe679M-6wbOBiKYq_oAoRe551IFxBpE38gnHQbZwCu87zES0MRBuqKFUFSvBJ6m69Uk9DXw6qPTPK12dtz9kAKrkuXrDi53DNnccZZuqOiB13XvM_JIN3X02kgxRuZ7VfI/s640/13.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><b><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Step 2. Add service reference.</span></span></span></span></b></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><b><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></b></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Remember that </span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">our service is now hosted on iis. So in order to add the reference, expand the console project and right click References -> Add Service Reference. It will show up a popup where we have to enter the service url which should something like: 'http://localhost/WcfBasicAuth/Service1.svc'</span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><b><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></b></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_u8BTYFns3oHxryRYJk8c1d5bOsIrtOOk-YvgNg1SGX5qIkEGxmpDKNTd643dzfFdH45anp6j-0OvCykkuYuD3th6nOkVhthw8KMwVRxWzhcI9rFJUrtRI2d-GeNGOvtiaV3gHkvJno/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="560" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_u8BTYFns3oHxryRYJk8c1d5bOsIrtOOk-YvgNg1SGX5qIkEGxmpDKNTd643dzfFdH45anp6j-0OvCykkuYuD3th6nOkVhthw8KMwVRxWzhcI9rFJUrtRI2d-GeNGOvtiaV3gHkvJno/s640/14.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">When you press Ok, you will be prompted for your credentials, and you will receive a warning.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKcWIp3-O9lzzcC0vYrFjC-IADFAVLmJPBDdu-glN2-G0Sdboj6t77qCmgQwtskSHaEd0uTueyg0zt2OvQKWNyAEmAUKsqFJFrJw0XqGzqsH1aavMINRxuqtrzslUuZwJxrrkmoX7wT2c/s1600/15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="562" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKcWIp3-O9lzzcC0vYrFjC-IADFAVLmJPBDdu-glN2-G0Sdboj6t77qCmgQwtskSHaEd0uTueyg0zt2OvQKWNyAEmAUKsqFJFrJw0XqGzqsH1aavMINRxuqtrzslUuZwJxrrkmoX7wT2c/s640/15.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">This is the request credentials pop up.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3tW8BFrPJb-KPF_PuxsStVB8eq7lBNq4-YOoFRwUX0PAtYT6wb7hTElvTawVcly-GlimRx3MF9DZfvX_QGOBBoKkPFIPieJ8mjBceg5geGhhWViM4KNOzGjFI_ujIMFWmDEU7d3y2Ino/s1600/16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="564" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3tW8BFrPJb-KPF_PuxsStVB8eq7lBNq4-YOoFRwUX0PAtYT6wb7hTElvTawVcly-GlimRx3MF9DZfvX_QGOBBoKkPFIPieJ8mjBceg5geGhhWViM4KNOzGjFI_ujIMFWmDEU7d3y2Ino/s640/16.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Enter your credentials and press ok. The service reference is added to your application.</span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><b>Step 3. Instantiate the service and call method</b></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><b><br /></b></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">The last thing to do now is to instantiate the service, set the </span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">ClientCredentials</span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"> and call the method. The credentials are your logon credentials.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieHGuSTH5V7XePxxUpvqeE9I85MdU5LA5-n8vneTFrLQ4q5SLjItjuv6Z19NeYRBRKjA_sDfkRxae8Q6CgRYYhIc5S8RRBEuBmrKoCLTl0Z2D4rIjiY28cviylEtuDJmF4vADO9a4WEBQ/s1600/17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="450" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieHGuSTH5V7XePxxUpvqeE9I85MdU5LA5-n8vneTFrLQ4q5SLjItjuv6Z19NeYRBRKjA_sDfkRxae8Q6CgRYYhIc5S8RRBEuBmrKoCLTl0Z2D4rIjiY28cviylEtuDJmF4vADO9a4WEBQ/s640/17.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">Note: before you can test it, you must set the console application as start project.Right click on the console project -> Set as startup project.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"></span></span></span></span><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;">And here is the result if your credentials are good:</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy6P16UhW7gnTa5XqSmxZDXCs85VdG_9BE52uCvJbKN6v-Y5ABTcZfnTDljoxvX0B4Vl-ZluRj_bSCtGoYBJ6xmB60a4axQkzP73RQEd7aKQgPRKxaQC7thEyILcI7VBAOpTrD2tS1bSs/s1600/18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy6P16UhW7gnTa5XqSmxZDXCs85VdG_9BE52uCvJbKN6v-Y5ABTcZfnTDljoxvX0B4Vl-ZluRj_bSCtGoYBJ6xmB60a4axQkzP73RQEd7aKQgPRKxaQC7thEyILcI7VBAOpTrD2tS1bSs/s640/18.png" width="640" /></a></div>
<div>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-size: small;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span><span style="background-color: #444444;"><span style="font-family: "Verdana", sans-serif;"><span style="color: #444444;"><span style="background-color: white;"><br /></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="color: #444444;"><span style="background-color: white;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;">Let me know what you think. Stay close for more step by step demos using transport security mode (https with ssl certificate), custom user name and password, Authentication Service in WCF.</span></span></span></span></span></span></span></span></span></span></span></span></span></span><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="font-family: "Verdana", sans-serif; font-size: small;"><a href="https://skydrive.live.com/redir.aspx?cid=a10f0f7bf1b982fc&resid=A10F0F7BF1B982FC!126&parid=root" target="_blank">Download code</a></span>
<span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: white;"><span style="background-color: #444444;"><span style="color: #444444;"><span style="background-color: white;"><span style="font-family: "Verdana", sans-serif;"><span style="font-size: small;"><br /></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div>Anonymoushttp://www.blogger.com/profile/06812084235260282116noreply@blogger.com0Cluj-Napoca, Romania46.777248 23.5998946.690255 23.441961499999998 46.864241 23.7578185