WCF SSL端点地址不是HTTPS

bis*_*iso 5 ssl wcf

我试图在我的PC(IIS 7)本地托管我的SSL WCF服务,由于某种原因我无法连接到它.我需要的是在调用某个函数之前使用SSL并发送信用证来验证用户.

当我连接到它时,我得到了没有端点监听https:// [计算机名称] /YYY.svc可以接受该消息.这通常是由错误的地址或SOAP操作引起的.有关更多详细信息,请参阅InnerException(如果存在).

内部消息是远程服务器返回错误:(404)Not Found.

我注意到的是,当我访问WSDL(通过https托管)时,端点地址不是http*S*,我认为这就是我的服务可能失败的原因.

这是我的WSDL的一部分

<wsdl:service name="WSNAME">
<wsdl:port name="WSHttpBinding_INams" binding="tns:WSHttpBinding_INams">
 <soap12:address location="http://[computer name]/YYY.svc" /> 
  <wsa10:EndpointReference>
    <wsa10:Address>http://[computer name]/YYY.svc</wsa10:Address> 
     <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
       <Spn>host/[computername]</Spn> 
     </Identity>
 </wsa10:EndpointReference>
Run Code Online (Sandbox Code Playgroud)

这是我的服务配置文件

 <service behaviorConfiguration="test" name="NewServiceType">
    <endpoint address="https://[computer name]/YYY.svc" binding="wsHttpBinding"
      bindingConfiguration="WsBinding" name="WS" contract="Authentication2.INams" />
    <endpoint address="mex" binding="mexHttpBinding" name="MX" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="https://[computer name]/XXX.svc" />
      </baseAddresses>
    </host>
Run Code Online (Sandbox Code Playgroud)

任何人都可以指出我做错了什么?

我的web.config

   <system.serviceModel>
<protocolMapping>
  <remove scheme="http" />
  <add scheme="http" binding="wsHttpBinding" />
</protocolMapping>
<bindings>
  <wsHttpBinding>
    <binding name="wsbinding">
      <security mode="TransportWithMessageCredential">
        <transport proxyCredentialType="Basic" />
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="NewServiceType">
    <endpoint address="/WS" binding="wsHttpBinding"
      bindingConfiguration="wsbinding" name="WS" contract="Authentication3.IService1" />

    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
      name="MX" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"
        httpsGetUrl="https://[computerName]/Service1.svc" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
Run Code Online (Sandbox Code Playgroud)

bis*_*iso 15

找到了 !!

WCF服务通过https而不是http返回404

问题是我的服务元素名称是编辑器默认添加的"MyNewService"或默认名称.您必须使用完全限定名称..

<services>
  <service name="[Namespace].[service class name]">
Run Code Online (Sandbox Code Playgroud)

这花费了我超过2天的不断工作和研究.如果这适合你,请投票给那些家伙回答 - 没有人提到这一点..我不能因为我还是新的