WCF 4:启用SSL端口的XP(IIS 5)上的无文件激活失败
我有一个服务通过无文件激活托管在XP上的IIS中。当没有为IIS启用SSL端口时,服务启动正常,但当启用SSL端口时,我收到错误消息: System.ServiceModel.ServiceActivationException:由于编译期间出现异常,无法激活服务“/SkillsPrototype.Web/services/Linkage.svc”。异常消息为:绑定实例已与侦听URI“”关联。如果两个端点想要共享同一个ListenUri,它们还必须共享同一个绑定对象实例。在AddServiceEndpoint()调用、配置文件或AddServiceEndpoint()和config的组合中指定了两个冲突的端点。->System.InvalidOperationException:绑定实例已与侦听URI“”关联。如果两个端点想要共享同一个ListenUri,它们还必须共享同一个绑定对象实例。在AddServiceEndpoint()调用、配置文件或AddServiceEndpoint()和config的组合中指定了两个冲突的端点 我的服务模型配置是WCF 4:启用SSL端口的XP(IIS 5)上的无文件激活失败,wcf,ssl,.net-4.0,activation,Wcf,Ssl,.net 4.0,Activation,我有一个服务通过无文件激活托管在XP上的IIS中。当没有为IIS启用SSL端口时,服务启动正常,但当启用SSL端口时,我收到错误消息: System.ServiceModel.ServiceActivationException:由于编译期间出现异常,无法激活服务“/SkillsPrototype.Web/services/Linkage.svc”。异常消息为:绑定实例已与侦听URI“”关联。如果两个端点想要共享同一个ListenUri,它们还必须共享同一个绑定对象实例。在AddServiceE
<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>
524333
3.
0
8.
卷轴
http://msdn.microsoft.com/en-US/library/System.ServiceModel.ServiceHostBaseAddresses.aspx
服务主机基址。
/LM/w3svc/1/ROOT/SkillsPrototype.Web-1-129211836532542949
System.ServiceModel.WebScriptServiceHost/49153359
http://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc
https://rcollet.hsb-corp.hsb.com/SkillsPrototype.Web/Services/Linkage.svc
由于帖子中的字符限制,我无法发布完整的服务日志。在这方面花费数小时后,我会在发布后很快解决问题 该问题似乎与使用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>