c# - 无法使用 https 端点创建 wcf web 服务

标签 c# wcf web-services https

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

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

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>

最佳答案

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

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

非常感谢。

关于c# - 无法使用 https 端点创建 wcf web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7467797/

相关文章:

c# - IIS 7 Http Handler 开发问题

c# - 具有多态数组的 WCF 客户端调用方法失败

.net - WCF 服务无法登录到远程数据库

java - 如何在 ReSTLet 中发送错误响应?

c# - PHP 中的命名参数

c# - 获取 List 及其嵌套列表属性的所有值

c# - 使用 dllimport 为多个参数设置不同的字符集

c# - 未调用 WCF 服务回调

java - 了解 REST API——什么是 Context 和 @Context?

c# - 如何创建一个基于xsd文件接收和发送xml的web服务?