无法为一个WCF服务公开两个终结点
我试图用两个端点建立一个WCF服务,这两个端点都公开了相同的服务契约,如下所示 我想让客户知道的是 及 问题似乎与多个基址有关 如果我在每个端点中显式指定完整地址,并省略baseAddress部分,则会出现以下错误 “在配置中将'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'设置为true时,终结点需要指定相对地址。如果在终结点上指定相对侦听URI,则地址可以是绝对的。若要解决此问题,请为终结点”“”“指定相对URI。” 因此,我将相对地址放在端点中,并添加一个基址 找不到与绑定为WSHttpBinding的终结点的方案https匹配的基址。注册的基址方案为[http] 我觉得我好像在绕圈子。非常感谢您的帮助无法为一个WCF服务公开两个终结点,wcf,iis,endpoint,Wcf,Iis,Endpoint,我试图用两个端点建立一个WCF服务,这两个端点都公开了相同的服务契约,如下所示 我想让客户知道的是 及 问题似乎与多个基址有关 如果我在每个端点中显式指定完整地址,并省略baseAddress部分,则会出现以下错误 “在配置中将'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'设置为true时,终结点需要指定相对地址。如果在终结点上指定相对侦听URI,则地址可以是绝对的。若要解决此问题,请为终结
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBindingConfiguration" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport" >
<transport clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="ServiceBehavior" name="myService">
<endpoint address="nonsecure"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBindingConfiguration"
contract="ImyService"
name="myService" />
<endpoint address="https://server:443/myService.svc"
binding="wsHttpBinding"
bindingConfiguration="wsHttpBindingConfiguration"
contract="ImyService"
name="myService" />
<host>
<baseAddresses>
<add baseAddress="http://server:1955/myService/" />
<add baseAddress="https://server:443/myService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>