5181john
5181john

Reputation: 21

http wcf error "Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding..."

am getting this error when i try to call my custom svc file from sharpoint. i have posted my web.config file here, could you guys tell wats wrong with this.

am trying to have my custom webservice in the sharepoint, so i created a project but due to this error i could not browse my web methods.

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="AlertWcfService.CustomServiceBehaviour"
        name="AlertWcfService.AlertService">
        <endpoint address="http://localhost:2000/" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration"
                  contract="AlertWcfService.IAlertService" >
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:2000/"></add>
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBindingConfiguration">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
            <message clientCredentialType="Certificate" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="AlertWcfService.CustomServiceBehaviour">
          <!--<serviceMetadata httpsGetEnabled="false"/>-->
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Upvotes: 2

Views: 10776

Answers (2)

TLAw
TLAw

Reputation: 1

In your interface declaration IAlertService, add the name attribute beside the namespace if you do not have it yet...

[ServiceContract(Name = "NameNeeded", Namespace = "http://blahbalh")]
    public interface IAlertService
{
.....
}

Upvotes: 0

tomasr
tomasr

Reputation: 13849

The error is that you're not using HTTPS, but you're using an MEX binding for HTTPS rather than HTTP. TO fix this, change this line:

    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

To

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

Upvotes: 10

Related Questions