2

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>
DeanOC
  • 7,142
  • 6
  • 42
  • 56
5181john
  • 21
  • 1
  • 2

2 Answers2

10

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" />
tomasr
  • 13,683
  • 3
  • 38
  • 30
0

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
{
.....
}
AbcAeffchen
  • 14,400
  • 15
  • 47
  • 66
TLAw
  • 1