Wcf 完全移除<;系统服务模型>;但仍然收到多个http端点错误
我得到这个错误: 此集合已包含具有方案http的地址。此集合中每个方案最多只能有一个地址。如果您的服务托管在IIS中,则可以通过将“system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled”设置为true或指定“system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters”来修复此问题 如果设置,则会出现以下错误: 在配置中将“system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled”设置为true时,端点需要指定相对地址。如果在端点上指定相对侦听URI,则地址可以是绝对地址。若要解决此问题,请为端点指定相对uri 好的,我的问题是,如果我从配置文件中完全删除整个部分,我仍然会收到第一个错误。这意味着IIS认为我有多个端点,而配置文件中却没有这样的端点。 我在windows 2012服务器(IIS 8)上安装了新的IIS,asp.net页面可以正常托管。该应用程序在windows 7和windows 2003服务器(iis 6)上运行良好 这是配置文件的“我的服务模型”部分:Wcf 完全移除<;系统服务模型>;但仍然收到多个http端点错误,wcf,iis-8,windows-server-2012,Wcf,Iis 8,Windows Server 2012,我得到这个错误: 此集合已包含具有方案http的地址。此集合中每个方案最多只能有一个地址。如果您的服务托管在IIS中,则可以通过将“system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled”设置为true或指定“system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters”来修复此问题 如果设置,则会出现以下错误: 在配置中将“
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<service behaviorConfiguration="metadataSupport_Behaviour" name="myserver.Service.Gateway">
<host>
<baseAddresses>
<add baseAddress="http://www.myserver.com.au/Service/"/>
</baseAddresses>
</host>
<endpoint binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_Configuration_NoSecurity" contract="myserver.Service.IGateway"
address="Gateway.svc" listenUri="http://www.myserver.com.au/Service/Gateway.svc">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_Configuration_NoSecurity" receiveTimeout="23:10:00" sendTimeout="23:10:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32000" maxStringContentLength="8192000" maxArrayLength="16384000" maxBytesPerRead="1024000" maxNameTableCharCount="16384000" />
<security mode="None">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport_Behaviour">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://www.myserver.com.au/Service/Gateway.svc" httpsGetEnabled="true"
httpsGetUrl="https://www.myserver.com.au/Service/Gateway.svc"/>
<serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="false" httpsHelpPageEnabled="false"/>
</behavior>
<behavior name="basicHttp_ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
请帮忙 ok通过完全剥离所有servicemodel部分并将其替换为以下内容,使其正常工作:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
以上是新创建的.net 4.5 WCF IIS托管服务的默认服务配置。这意味着我必须添加/编辑以下内容:
<httpRuntime targetFramework="4.5"/>
<compilation targetFramework="4.5"/>
通过完全剥离所有servicemodel部分并用以下内容替换,ok成功地使其工作:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
以上是新创建的.net 4.5 WCF IIS托管服务的默认服务配置。这意味着我必须添加/编辑以下内容:
<httpRuntime targetFramework="4.5"/>
<compilation targetFramework="4.5"/>