Click here to Skip to main content
15,885,953 members
Articles / Operating Systems / Windows

Simple Web Service using WCF (Windows Communication Framework)

Rate me:
Please Sign up or sign in to vote.
4.89/5 (27 votes)
2 Jan 20073 min read 348.3K   7.7K   95  
This article shows you how easy it is to set up a web service using Windows Communication Framework.
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
	<system.serviceModel>
		<services>
      <service name="WCFSample.EchoImplementation" behaviorConfiguration="returnFaults">
				<endpoint contract="WCFSample.IEchoContract" binding="basicHttpBinding"/>
				<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"></endpoint>
			</service>
		</services>
		<behaviors>
			<serviceBehaviors>
				<behavior name="returnFaults">
					<serviceDebug includeExceptionDetailInFaults="true"/>
					<serviceMetadata httpGetEnabled="true"></serviceMetadata>
				</behavior>
			</serviceBehaviors>
		</behaviors>
	</system.serviceModel>
	<system.web>
		<compilation debug="true">
			<assemblies>
				<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="Microsoft.Transactions.Bridge, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.IdentityModel.Selectors, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
  </assemblies>
		</compilation>
		<identity impersonate="false"/>
	</system.web>
	<system.diagnostics>
	</system.diagnostics>
	<system.webServer>
		<directoryBrowse enabled="true"/>
		<validation validateIntegratedModeConfiguration="false"/>
	</system.webServer>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
I've been a programmer for longer than I care to remember. It all started with those BBC (model B's) at school, it all went down hill from there.....

This year, I am mostly coding in.. C# (WPF & WCF)

Blog Address http://markpm.blogspot.com


Comments and Discussions