0

"The service certificate is not provided. Specify a service certificate in ServiceCredentials." is what I see when I point my browser to the svc file address

as you can see below, my serviceCredentials section is commented (it's just an example from some book), since I don't want any certificate. But apparently I can't avoid it... what can I do ?

I can't use basicHttpBinding because I want sessions support

my binding:

<wsHttpBinding>
   <binding name="BindingToViewer" sendTimeout="00:25:00">
      <security mode="Message">
         <message clientCredentialType = "None"/>
      </security>
   </binding>
</wsHttpBinding>

my service:

<service name="SomeNs.Whatever.ServName" behaviorConfiguration="NoPrinPermMode">
   <endpoint address="" binding="wsHttpBinding"
                   bindingConfiguration="BindingToViewer"
                   contract="SomeNs.Whatever.IMyInterface">
      <identity>
         <dns value="localhost" />
      </identity>
   </endpoint>
   <host>
      <baseAddresses>
         <add baseAddress="https://localhost/"/>
      </baseAddresses>
   </host>
</service>

my service behaviors:

<serviceBehaviors>
   <behavior name="NoPrinPermMode">
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
      <serviceAuthorization principalPermissionMode="None" />
      <!--<serviceCredentials>
         <serviceCertificate
            findValue = "MyServiceCert"
            storeLocation = "LocalMachine"
            storeName = "My"
            x509FindType = "FindBySubjectName"/>
      </serviceCredentials>-->
   </behavior>
</serviceBehaviors>
4

2 回答 2

1

您已在 WSHttpBinding 中配置消息安全性,这意味着您的服务必须提供证书(除非您使用 Windows 身份验证)。问题是你需要什么样的安全性?

于 2013-09-13T20:50:26.663 回答
1

不要在基地址中使用 https:

<add baseAddress="https://localhost/"/>

改用:

<add baseAddress="http://localhost/"/>

并删除 httpsGetEnabled:

<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />

至:

<serviceMetadata httpGetEnabled="True" />

并删除身份,因为您不需要验证服务

      <identity>
     <dns value="localhost" />
  </identity>

编辑 删除也

 <security mode="Message">
    <message clientCredentialType = "None"/>
  </security>
于 2013-09-13T19:45:01.757 回答