Click here to Skip to main content
15,892,537 members
Articles / Web Development / IIS

Transactional Web Services with WS-AtomicTransaction

Rate me:
Please Sign up or sign in to vote.
3.91/5 (12 votes)
12 Jun 2008CPOL6 min read 137.3K   491   48  
Explains a simple way of using WS-AtomicTransaction to create distributed transactions across Web services
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
	<appSettings/>
	<connectionStrings>
		<add name="MyDatabase" connectionString="Data Source=localhost;Initial Catalog=WsatTest;User Id=test;Pwd=test"/>
	</connectionStrings>
	<system.serviceModel>
		<services>
			<service name="TransactionalWebService" behaviorConfiguration="ServiceBehavior">
				<endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding1" contract="Common.ITransactionalWebService"/>
				<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
			</service>
		</services>
		<bindings>
			<wsHttpBinding>
				<binding name="Binding1" transactionFlow="true">
				</binding>
			</wsHttpBinding>
		</bindings>
		<behaviors>
			<serviceBehaviors>
				<behavior name="ServiceBehavior" returnUnknownExceptionsAsFaults="True">
					<serviceMetadata httpGetEnabled="true" />
				</behavior>
			</serviceBehaviors>
		</behaviors>
	</system.serviceModel>
	<system.web>
		<compilation debug="true" defaultLanguage="c#">
			<assemblies>
				<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
				<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.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>
		<authentication mode="Windows"/>
	</system.web>
</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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions