Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF: A registration already exists for URI

Tags:

uri

https

wcf

iis-6

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>

like image 995
A. Agius Avatar asked Dec 05 '25 14:12

A. Agius


2 Answers

Added /mex after .svc extension and worked

<serviceMetadata httpsGetEnabled="true" httpsGetUrl="https://*******.com/*****/*****.svc/mex" />
like image 123
A. Agius Avatar answered Dec 07 '25 14:12

A. Agius


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

like image 35
Bernoulli IT Avatar answered Dec 07 '25 14:12

Bernoulli IT