gpt4 book ai didi

WCF 4 : Fileless Activation Fails On XP (IIS 5) that has SSL port enabled

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:50 25 4
gpt4 key购买 nike

我通过无文件激活在 XP 上的 IIS 中托管了一项服务。当没有为 IIS 启用 SSL 端口时服务启动正常,但当启用 SSL 端口时,我收到错误消息:

System.ServiceModel.ServiceActivationException: The service '/SkillsPrototype.Web/services/Linkage.svc' cannot be activated due to an exception during compilation. The exception message is: A binding instance has already been associated to listen URI 'http://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config. . ---> System.InvalidOperationException: A binding instance has already been associated to listen URI 'http://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.

我的服务模型配置是

  <system.serviceModel>
<diagnostics wmiProviderEnabled="true">
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000"/>
</diagnostics>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding>
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
</protocolMapping>
<services>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false">
<serviceActivations>
<clear/>
<add factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" service="SkillsPrototype.ServiceModel.Linkage" relativeAddress="~/Services/Linkage.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>

当您查看 svclog 文件时,会发现启用 SSL 时会返回两个基地址,一个用于 http,一个用于 https。我怀疑这是问题的一部分,但我不确定如何解决。

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524333</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2010-06-16T17:40:55.8168605Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{95927f9a-fa90-46f4-af8b-721322a87aaa}" />
<Execution ProcessName="aspnet_wp" ProcessID="1888" ThreadID="5" />
<Channel/>
<Computer>RCOLLET</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.ServiceHostBaseAddresses.aspx</TraceIdentifier>
<Description>ServiceHost base addresses.</Description>
<AppDomain>/LM/w3svc/1/ROOT/SkillsPrototype.Web-1-129211836532542949</AppDomain>
<Source>System.ServiceModel.WebScriptServiceHost/49153359</Source>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/CollectionTraceRecord">
<BaseAddresses>
<Address>http://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc</Address>
<Address>https://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc</Address>
</BaseAddresses>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

由于帖子的字符限制,我无法发布完整的服务日志。

最佳答案

据我所知,我花了几个小时解决了这个问题,并在发布后不久解决了这个问题。

问题似乎与使用 WebScriptServiceHostFactory 有关。相反,我创建了一个带有 kind 属性的服务条目,现在它可以工作了。

修改后的配置

  <system.serviceModel>
<diagnostics wmiProviderEnabled="true">
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000"/>
</diagnostics>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<!--Default settings for the webHttpBinding-->
<binding>
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
</protocolMapping>
<services>
<service name="SkillsPrototype.ServiceModel.Linkage">
<endpoint
kind="webScriptEndpoint"
contract="SkillsPrototype.ServiceModel.ILinkage"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false">
<serviceActivations>
<clear/>
<add service="SkillsPrototype.ServiceModel.Linkage" relativeAddress="~/Services/Linkage.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>

关于WCF 4 : Fileless Activation Fails On XP (IIS 5) that has SSL port enabled,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3056599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com