WCF: A registration already exists for URI

13,865

Solution 1

Added /mex after .svc extension and worked

<serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://*******.com/*****/*****.svc/mex" />

Solution 2

Take a look at a-registration-already-exists-for-uri-when-hosting-same-service-for-https-and. It seems like the same problem...

Or this one: wcf-inner-exception-message-a-registration-already-exists-for-uri-net-tcp

Share:
13,865
A. Agius
Author by

A. Agius

Updated on June 04, 2022

Comments

  • A. Agius
    A. Agius almost 2 years

    I have the below in my WCF Web.Config. When I try to access the WCF service I am getting the "A registration already exists for URI" error. The WCF Service is hosted in an SSL enviroment.

    Can anyone help please?

      <system.serviceModel>
        <bindings>
            <basicHttpBinding>
              <binding name="WSBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                receiveTimeout="00:01:00" sendTimeout="00:01:00" allowCookies="false"
                bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="52428800" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                 maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None" />
              </binding>
            </basicHttpBinding>
    
            <webHttpBinding>
              <binding name="SOAPBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                 receiveTimeout="00:01:00" sendTimeout="00:01:00" allowCookies="false"
                 bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                 maxBufferPoolSize="524288" maxReceivedMessageSize="52428800" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                 maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None" />
              </binding>
            </webHttpBinding>
          </bindings>
        <behaviors>
          <endpointBehaviors>
             <behavior name="wsHTTPBehavior">
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
              </behavior>
    
            <behavior name="jsonBehavior">
              <webHttp />
            </behavior>
    
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="WsBehavior">
            <serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://*******.com/*****/*****.svc" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
    
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="***.***" behaviorConfiguration="WsBehavior">
        <endpoint behaviorConfiguration="wsHTTPBehavior" binding="basicHttpBinding" contract="***.***" bindingConfiguration="WSBinding" />
        <endpoint address="xml" behaviorConfiguration="jsonBehavior" binding="webHttpBinding" contract="***.***" bindingConfiguration="SOAPBinding" name="SOAP" />
      </service>
    </services>