Click here to Skip to main content
15,884,987 members
Articles / Programming Languages / C#

Automating Windows Applications Using the WCF Equipped Injected Component

Rate me:
Please Sign up or sign in to vote.
4.96/5 (47 votes)
15 Nov 2010CPOL14 min read 102.5K   2K   122  
A .NET WCF equipped component injected into automated process allows both local and remote clients to control the process and get its asynchronous events.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<appSettings>
		<!-- Replace "localhost" with Notepad Machine IP Address -->
		<add key ="EndpointAddressUri" value="http://localhost:29700" />
		<add key ="Client-Injector" value="true" />
	</appSettings>
	
	<system.serviceModel>

		<bindings>
			<basicHttpBinding>
				<binding name="binding1_INotification" closeTimeout="00:01:00"
				  openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
				  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
				  maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
				  messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
				  useDefaultWebProxy="true">
					<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
					  maxBytesPerRead="4096" maxNameTableCharCount="16384" />
					<security mode="None">
						<transport clientCredentialType="None" proxyCredentialType="None"
						  realm="" />
						<message clientCredentialType="UserName" algorithmSuite="Default" />
					</security>
				</binding>
			</basicHttpBinding>
		</bindings>

		<services>
			<service behaviorConfiguration="NotificationBehavior" name="AutomationClientNET.Notification">
				<endpoint address="Notification" binding="basicHttpBinding" contract="AutomationClientNET.INotification" />
				<endpoint address="Mex" binding="mexHttpBinding" contract="IMetadataExchange" />
				<host>
					<baseAddresses>
						<!-- Replace "localhost" with Client Machine IP Address -->
						<add baseAddress="http://localhost:29701" /> 
					</baseAddresses>
				</host>
			</service>
		</services>

		<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
		<behaviors>
			<serviceBehaviors>
				<behavior name="NotificationBehavior">
					<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
					<serviceDebug includeExceptionDetailInFaults="false" />
				</behavior>
			</serviceBehaviors>
		</behaviors>

	</system.serviceModel>
</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 (Senior)
Israel Israel


  • Nov 2010: Code Project Contests - Windows Azure Apps - Winner
  • Feb 2011: Code Project Contests - Windows Azure Apps - Grand Prize Winner



Comments and Discussions