繁体   English   中英

wcf服务配置重复的端点

[英]Duplicated endpoints wcf service config

嗨,我正在尝试将我的wcf配置为能够使用https,但是我收到以下错误:

绑定实例已经关联到侦听URI'http://devwcfinternal/TestApp/FastquoteWcfService.svc '。 如果两个端点要共享相同的ListenUri,则它们还必须共享相同的绑定对象实例。 这两个冲突的端点是在AddServiceEndpoint()调用中,配置文件中指定的,或者是AddServiceEndpoint()和config的组合。

我查看过的所有内容都是为了确保我的服务具有不同的地址,并据我所知:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <pages controlRenderingCompatibilityVersion="4.0" />
    <customErrors mode="Off" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <etwTracking profileName="EndToEndMonitoring Tracking Profile" />
        </behavior>
        <behavior name="wsSecureBehavior">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
    <protocolMapping>
      <add scheme="http" binding="basicHttpBinding" />
      <add scheme="https" binding="wsHttpBinding" />
    </protocolMapping>
    <diagnostics etwProviderId="830b12d1-bb5b-4887-aa3f-ab508fd4c8ba">
      <endToEndTracing propagateActivity="true" messageFlowTracing="true" />
    </diagnostics>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IWcfService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="9999999" maxBufferPoolSize="524288" maxReceivedMessageSize="9999999" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_MARAX2012QuoteService">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </basicHttpBinding>
      <wsHttpBinding>
        <binding name="wsHttp_IFastQuoteService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="wsSecureBehavior" name="WcfService.FastquoteService">
        <endpoint address="secure" binding="wsHttpBinding" bindingConfiguration="wsHttp_IFastQuoteService" name="FastQuoteServiceSecure" contract="WcfService.IFastquoteService" />
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" name="FastQuoteService" contract="WcfService.IFastquoteService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" name="mex" />
      </service>
    </services>
    <client>
      <endpoint address="http://devwcfinternal/AXWcfService/AXWcfService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="AXWcfService.IAXWcfService" name="BasicHttpBinding_IAXWcfService" />
      <endpoint address="http://devwcfinternal/NotesWcfService/NotesWcfService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="NotesWCFService.INotesWcfService" name="BasicHttpBinding_INotesWcfService" />
      <endpoint address="http://devwcfinternal/AddressSearchService/AddressFinder.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="AddressSearchService.IAddressFinder" name="IAddressFinder" />
      <endpoint address="http://devwcfinternal/NotificationsWcfService/NotificationsService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="NotificationsWcfService.INotificationsService" name="BasicHttpBinding_INotificationsWcfService" />
      <endpoint address="http://devwcfinternal/UsersWcfService/UsersWcfService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="UsersWcfService.IUsersService" name="BasicHttpBinding_IUsersService" />
      <endpoint address="http://devwcfinternal/CustomerContactsWcfService/CustomerContactsService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="CustomerContactsWcfService.ICustomerContactsService" name="BasicHttpBinding_ICustomerContactsService" />
      <endpoint address="http://devwcfinternal/CustomerActivity/CustomerActivityWcfService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" contract="CustomerActivityWcfService.ICustomerActivityWcfService" name="BasicHttpBinding_ICustomerActivityWcfService" />
      <endpoint address="http://ax12aosdev/MicrosoftDynamicsAXAif60/MARQuoteService/xppservice.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_MARAX2012QuoteService" contract="Ax2012QuotesService.MARAX2012QuoteService" name="BasicHttpBinding_Ax2012QuotesService" />
    </client>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
    <handlers>
      <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral,                      PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
  </system.webServer>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>

谁能看到配置有什么问题或知道如何解决端点错误?

好的,事实证明我很忙,还要检查地址端点,您需要检查端点协定和服务名称。 我的配置应该是:

      <service behaviorConfiguration="wsSecureBehavior" name="WcfService.FastquoteWCFService">
        <endpoint address="secure" binding="wsHttpBinding" bindingConfiguration="wsHttp_IFastQuoteService" name="FastQuoteServiceSecure" contract="WcfService.IFastquoteWCFService" />
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfService" name="FastQuoteService" contract="WcfService.IFastquoteWCFService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" name="mex" />
      </service>

错过了服务名称和端点合同中的WCF位

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM