2015-01-02 69 views
0

我在我的解決方案中使用了WCF服務。它可以正常使用http localhost。安裝它不以https localhost.This工作證書後是配置,WCF服務與IIS Express中的https不起作用

<system.serviceModel> 
    <bindings> 
    <customBinding> 
     <binding name="RawReceiveCapable"> 
      <webMessageEncoding webContentTypeMapperType="SmsService.RawContentTypeMapper, SmsService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> 
      <httpsTransport authenticationScheme="Basic" manualAddressing="true" maxReceivedMessageSize="524288000" transferMode="Streamed" /> 
     </binding> 
    </customBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="ServiceBehavior"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
    <behavior name="EndpBehavior"> 
     <webHttp /> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 
<services> 
    <service behaviorConfiguration="ServiceBehavior" name="TR_Registry.Service1"> 
    <!--<endpoint address="" binding="webHttpBinding" contract="TR_Registry.IService1" behaviorConfiguration="EndpBehavior" />--> 
    <!--<endpoint address="" binding="basicHttpBinding" contract="TR_Registry.IService1"></endpoint>--> 
    <endpoint address="" 
       binding="basicHttpBinding" 
       bindingConfiguration="secureHttpBinding" 
       contract="TR_Registry.IService1"/> 

    <endpoint address="mex" 
       binding="mexHttpsBinding" 
       contract="IMetadataExchange" /> 
    </service> 
</services> 

回答

0

嘗試使用設置basicHttpBinding的細節和使用傳輸層安全

<bindings> 
    <basicHttpBinding> 
    <binding name="secureHttpBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </basicHttpBinding>  
</bindings> 
0

添加以下結合

<bindings> 
    <basicHttpBinding> 
    <binding name="secureHttpBinding"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

指定y我們的服務和服務端點

<service name="TR_Registry.Service1"> 
    <endpoint address="" 
       binding="basicHttpBinding" 
       bindingConfiguration="secureHttpBinding" 
       contract="TR_Registry.IService1"/> 

    <endpoint address="mex" 
       binding="mexHttpsBinding" 
       contract="IMetadataExchange" /> 
</service> 

有關詳情,請通過此鏈接http://msdn.microsoft.com/en-us/library/hh556232%28v=vs.110%29.aspx

+0

'一段單列用於彌補內嵌代碼。請停止使用它們來突出顯示單詞。 – meagar