在一个Windows服务中托管3 Wcf服务 [英] Hosting 3 Wcf Services in one windows service

查看:81
本文介绍了在一个Windows服务中托管3 Wcf服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了三个wcf服务,即

MyService1,MyService2,Myservice3和我在基地址中使用了3个不同的端口。



它当我打开测试客户端时工作正常。测试客户端正在添加3项服务。



但是当我在Windows服务中安装它时只有一项服务正在运行,其他两项服​​务无效



这是我的配置

I created a three wcf services i.e
MyService1,MyService2,Myservice3 and i used 3 different ports in base address.

It is working fine when i open test client.Test client is adding 3 services.

But when i install it in windows service only one service is working other two are not working

Here is my configuration

<system.serviceModel>
		<services>
			<service behaviorConfiguration="WCFServicesBehavior"

			 name="WCFServices">
				<endpoint address="" binding="netTcpBinding" bindingConfiguration="BACSnetTCPBinding1"

				 contract="IBACSWCFServices" />
				<endpoint address="mex" binding="customBinding" bindingConfiguration="TestMexBinding"

				 contract="IMetadataExchange" />
				<host>
					<baseAddresses>
						<add baseAddress="net.tcp://localhost:7001/BACSWCFServices/" />
					</baseAddresses>
				</host>
			</service>
			<service behaviorConfiguration="ArrangementServiceBehavior"

			 name="ArrangementService">
				<endpoint address="" binding="netTcpBinding" bindingConfiguration="BACSnetTCPBinding2"

				 contract="IArrangementService" />
				<endpoint address="mex" binding="customBinding" bindingConfiguration="TestMexBinding"

				 contract="IMetadataExchange" />
				<host>
					<baseAddresses>
						<add baseAddress="net.tcp://localhost:7002/BACSEmpIAArrangementService/" />
					</baseAddresses>
				</host>
			</service>
			<service behaviorConfiguration="CalcWCFServicesBehavior"

			 name="CalcWCFServices">
				<endpoint address="" binding="netTcpBinding" bindingConfiguration="BACSnetTCPBinding3" contract="ICalcWCFServices">
					
				</endpoint>
				<endpoint address="mex" binding="customBinding" bindingConfiguration="TestMexBinding" contract="IMetadataExchange" />
				<host>
					<baseAddresses>
						<add baseAddress="net.tcp://localhost:7003/CalcWCFServices/" />
					</baseAddresses>
				</host>
			</service>
		</services>
		<behaviors>
			<serviceBehaviors>
				<behavior name="WCFServicesBehavior">
					<serviceMetadata httpGetEnabled="false" />
					<serviceDebug includeExceptionDetailInFaults="false" />
					<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="50"

					 maxConcurrentInstances="2147483647" />
				</behavior>
				<behavior name="ArrangementServiceBehavior">
					<serviceMetadata httpGetEnabled="false" />
					<serviceDebug includeExceptionDetailInFaults="false" />
					<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="50"

					 maxConcurrentInstances="2147483647" />
				</behavior>
				<behavior name="CalcWCFServicesBehavior">
					<serviceMetadata httpGetEnabled="false" />
					<serviceDebug includeExceptionDetailInFaults="false" />
					<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="50"

					  maxConcurrentInstances="2147483647" />
				</behavior>
			</serviceBehaviors>
		</behaviors>
		<bindings>
			<customBinding>
				<binding name="TestMexBinding">
					<tcpTransport maxPendingConnections="50" listenBacklog="50">
						<connectionPoolSettings groupName="default"  maxOutboundConnectionsPerEndpoint="50" />
					</tcpTransport>
				</binding>
			</customBinding>
			<netTcpBinding>
				<binding name="BACSnetTCPBinding1"

							   closeTimeout="10:00:00"

							   openTimeout="10:01:00"

							   receiveTimeout="10:00:00"

							   sendTimeout="10:00:00" transactionFlow="false" transferMode="Buffered" hostNameComparisonMode="StrongWildcard"

							   listenBacklog="50"

							   maxConnections="50"

							   maxBufferPoolSize="2147483647"

							   maxBufferSize="2147483647"

							   maxReceivedMessageSize="2147483647">
						    <readerQuotas maxDepth="2147483647"

							  maxStringContentLength="2147483647"

							  maxArrayLength="2147483647"

							  maxBytesPerRead="2147483647"

							  maxNameTableCharCount="2147483647" />
					<reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false" />
					<security mode="Transport">
						<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
						<message clientCredentialType="Windows" />
					</security>
				</binding>
				<binding name="BACSnetTCPBinding2"

							   closeTimeout="10:00:00"

							   openTimeout="10:01:00"

							   receiveTimeout="10:00:00"

							   sendTimeout="10:00:00" transactionFlow="false" transferMode="Buffered" hostNameComparisonMode="StrongWildcard"

							   listenBacklog="50"

							   maxConnections="50"

							   maxBufferPoolSize="2147483647"

							   maxBufferSize="2147483647"

							   maxReceivedMessageSize="2147483647">
							<readerQuotas maxDepth="2147483647"

							  maxStringContentLength="2147483647"

							  maxArrayLength="2147483647"

							  maxBytesPerRead="2147483647"

							  maxNameTableCharCount="2147483647" />
					<reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false" />
					<security mode="Transport">
						<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
						<message clientCredentialType="Windows" />
					</security>
				</binding>
				<binding name="BACSnetTCPBinding3"

							   closeTimeout="10:00:00"

							   openTimeout="10:01:00"

							   receiveTimeout="10:00:00"

							   sendTimeout="10:00:00" transactionFlow="false" transferMode="Buffered" hostNameComparisonMode="StrongWildcard"

							   listenBacklog="50"

							   maxConnections="50"

							   maxBufferPoolSize="2147483647"

							   maxBufferSize="2147483647"

							   maxReceivedMessageSize="2147483647">
							<readerQuotas maxDepth="2147483647"

							  maxStringContentLength="2147483647"

							  maxArrayLength="2147483647"

							  maxBytesPerRead="2147483647"

							  maxNameTableCharCount="2147483647" />
					<reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false" />
					<security mode="Transport">
						<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
						<message clientCredentialType="Windows" />
					</security>
				</binding>
			</netTcpBinding>
		</bindings>
	</system.serviceModel>







Please i need help

do i need to change config......




Please i need help
do i need to change config......

推荐答案

Trying hosting the services with

Internet Internet Information Service(IIS) Manager

in ypur system and add services references of ur wcf’s

to the file in which you are working.
Trying hosting the services with
Internet Internet Information Service(IIS) Manager
in ypur system and add services references of ur wcf's
to the file in which you are working.


这篇关于在一个Windows服务中托管3 Wcf服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆