无法创建具有HTTPS端点的WCF web服务

本文关键字:WCF web 服务 端点 HTTPS 创建 | 更新日期: 2023-09-27 18:08:53

我想用https端点启用我的wcf服务。但我只能得到http地址,即使我将安全模式设置为传输。我还应该更改/添加什么才能使其工作?谢谢你。

编辑:我在IIS 6上,这里是来自服务器的安全绑定信息。

ServerBindings                  : (LIST) (1 Items)
  "10.1.0.195:80:hw.hello.com"
SecureBindings                  : (LIST) (2 Items)
  "10.1.0.195:443:hw.hello.com"
  "81.212.201.9:443:"

<wsdl:service name="HW">
 <wsdl:port name="webBinding_IHWMerkezWS" binding="tns:webBinding_IHWMerkezWS">
  <soap12:address location="http://hw.world.com/HWPostBox/services/HW.asmx" /> 
 <wsa10:EndpointReference>
  <wsa10:Address>http://hw.world.com/HWPostBox/services/HW.asmx</wsa10:Address> 
 <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
  <Dns>localhost</Dns> 
  </Identity>
  </wsa10:EndpointReference>
  </wsdl:port>
  </wsdl:service>

<wsHttpBinding>
 <binding name="webBinding">
   <security mode="Transport">
   <transport clientCredentialType="None" proxyCredentialType="None" realm=""></transport>
   <message clientCredentialType="Certificate" algorithmSuite="Default" />
   </security>
 </binding>

</wsHttpBinding>
    </bindings>
    <services>      
      <service name="HWPostBox.HW" behaviorConfiguration="HWPostBox.HWBehavior">
        <!-- Service Endpoints -->
        <endpoint address="" binding="wsHttpBinding" bindingName="webBinding" contract="CRLHW.HWWS.IHWMerkezWS">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HWPostBox.HWBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

无法创建具有HTTPS端点的WCF web服务

解决:我必须将bindingName属性更改为bindingConfiguration。

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="webBinding"...>
</endpoint>