[英]WCF Service Name & Binding Name
我在一個App.Config文件中組合了兩個WCF服務。 我無法運行(應用程序編譯但在初始化服務時失敗)。
我想知道我是否需要將服務名稱設置為與整體服務中定義的其他內容相同?
TypeInitializationException
{“服務'MurexUploadObjects.ResponseService'沒有應用程序(非基礎結構)端點。這可能是因為沒有為您的應用程序找到配置文件,或者因為在配置文件中找不到與服務名稱匹配的服務元素,或者因為沒有在服務元素中定義端點。“}
<system.serviceModel>
<configuration>
<behaviors>
<serviceBehaviors>
<behavior name="Service1Bevhavior">
</behavior>
<behavior name="Service2Bevhavior">
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="tcpBloombergServiceEndPoint" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:05:00"
enabled="true" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="TransactedBinding">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<!--SERVICE ONE-->
<service name="INSERT NAME HERE">
<endpoint address="net.tcp://AP434190:8732/BloombergService/"
binding="netTcpBinding"
contract="BloomberPriceListenerService.IBloombergPriceListenerService"
bindingConfiguration="tcpBloombergServiceEndPoint"
name="tcpBloombergServiceEndPoint" />
</service>
<!--SERVICE TWO-->
<service name="INSERT NAME HERE">
<endpoint address="net.tcp://localhost:8735/private/MurexUploadObjects/ResponseService"
binding="netTcpBinding"
contract="MurexUploadObjects.IResponseService"
bindingConfiguration="TransactedBinding"
name="TransactedBinding"/>
</service>
</services>
</system.serviceModel>
</configuration>
服務名稱必須是服務類的完全限定名稱,包括命名空間,例如
<service name="YourServiceNamespace.YourService">
它不能只是任何東西 - ServiceHost
使用服務類的名稱來查找正確的服務配置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.