Develop WCF service using WsHttpBinding

by Jagadish Pulakhandam on 5/10/2011 12:08:46 PM
Rated 0 from 0 votes
Brief: Demonstrates the development of a WCF Service Library (with WsHttpBinding) from the scratch.
Posted to: Windows Communication Foundation - Bindings
Add to DiggAdd to del.icio.usAdd to FURLAdd to RedditAdd to YahooAdd to BlinklistAdd to GoogleAdd to ma.gnoliaAdd to ShadowsAdd to Technorati

Demonstrates the following (see attached video):

  • Create a very basic WCF Service Library from the scratch (using Visual Studio 2010)
  • Configure WCF Service (with WsHttpBinding) using "WCF Service Configuration Editor"
  • Execute by hosting through "WCF Service Host"
  • Test the service using "WCF Test Client"
Source code is provided in previous article.  Configuration need to be changed as shown below:

01.<?xml version="1.0" encoding="utf-8" ?>
04.  <system.web>
05.    <compilation debug="true" />
06.  </system.web>
09.  <system.serviceModel>
10.    <behaviors>
11.      <serviceBehaviors>
12.        <behavior name="SampleCalcSvcBehavior">
13.          <serviceDebug includeExceptionDetailInFaults="true" />
14.          <serviceMetadata httpGetEnabled="true" />
15.        </behavior>
16.      </serviceBehaviors>
17.    </behaviors>
18.    <services>
19.      <service behaviorConfiguration="SampleCalcSvcBehavior" name="SampleCalcSvc.CalcService">
20.        <endpoint address="" binding="ws2007HttpBinding" bindingConfiguration=""
21.          name="SampleCalcSvcWsHttpEndPoint" contract="SampleCalcSvc.ICalcSvc" />
22.        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
23.          name="SampleCalcSvcMexHttpEndPoint" contract="IMetadataExchange" />
24.        <host>
25.          <baseAddresses>
26.            <add baseAddress="http://localhost:8080/SampleSvc" />
27.          </baseAddresses>
28.        </host>
29.      </service>
30.    </services>
31.  </system.serviceModel>

Join the .NET Code Central Community and join the discussion!
Signing-up is FREE and quick. Do it now, we want to hear your opinion

Rated 0 from 0 votes ( login  to rate)
DotnetKicks DotnetKicksDe DotNetShoutout

Attachments / Source Code
You need to Login or Join for FREE to download the following

Video/Screen Recording (may not have audio narration/annotations)
You need to Login or Join for FREE to download the following