简体   繁体   English

无法使用https端点创建WCF Web服务

[英]cannot create a wcf web service with https endpoint

I would like to enable my wcf service with https endpoints. 我想启用带有https端点的wcf服务。 but I only get http addresses, even though I set the security mode to transport. 但是即使将安全模式设置为传输,我也只能获得http地址。 what else should I change/add to get this working? 我还应该更改/添加什么才能使它正常工作? thanks a lot 非常感谢

edit: I am on IIS 6 and here is the secure binding info from the server. 编辑:我在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>

Solved: I had to change bindingName attribute to bindingConfiguration. 解决:我必须将bindingName属性更改为bindingConfiguration。

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

Thanks a lot. 非常感谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM