开发者

WCF Get HTTPS Config

I am trying to configure my WCF service enpoints to be HTTPs and support 2 WCF enpoints (1 regular, 1 RESTFUL (GET)).

I get the following error when I try to browse the SVC.

Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http]

Here are the relevant parts of my web.config

<bindings>
  <mexHttpsBinding>
    <binding name="mexHttpsBinding1"/>
 </mexHttpsBinding>
 <customBinding>
   <binding name="customBinding0">
     <binaryMessageEncoding>
       <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
     </binaryMessageEncoding>
     <httpTransport maxReceivedMessageSize="4194304" />
   </binding>
   <binding name="customBindingSecure">
     <binaryMessageEncoding>
       <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
     </binaryMessageEncoding>
     <httpsTransport maxReceivedMessageSize="4194304" />
   </binding>
 </customBinding>

<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
 <baseAddressPrefixFilters>
   <add prefix="https://myserver1">
   </add>
   <add prefix="http://myserver1">
   </add> 
 </baseAddressPrefixFilters>
</serviceHostingEnvironment>



<b开发者_开发问答ehaviors>
 <serviceBehaviors>
   <behavior name="MyService.Web.Services.Private.WebServiceBehavior">
     <serviceMetadata  httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" />
   </behavior>
   <behavior name="MyService.Web.Services.Public.WebServiceBehavior">
     <serviceMetadata  httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" />
   </behavior>
 </serviceBehaviors>
 <endpointBehaviors>
   <behavior name="ImageBehavior">
     <enableWebScript />
   </behavior>
 </endpointBehaviors>

<services>
  <service behaviorConfiguration="MyService.Web.Services.Private.WebServiceBehavior"
    name="MyService.Web.Services.Private.WebService">
    <endpoint address="https" behaviorConfiguration="ImageBehavior"
      binding="webHttpBinding" name="PrivateImageBehaviorHTTPs" contract="MyService.Web.Services.Private.WebService" />
    <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="mexHttpsBinding1" name="PrivateMex"
      contract="IMetadataExchange" />
    <endpoint address="https://myserver1/MyService.web.services/private/xifactoryusers.svc"
      binding="customBinding" bindingConfiguration="customBindingSecure"
      name="PrivateXIFactoryUsersHTTPs" contract="MyService.Web.Services.Private.WebService" />
  </service>
  <service behaviorConfiguration="MyService.Web.Services.Public.WebServiceBehavior"
    name="MyService.Web.Services.Public.WebService">
    <endpoint address="https" behaviorConfiguration="ImageBehavior"
      binding="webHttpBinding" name="PublicImageBehaviorHTTPs" contract="MyService.Web.Services.Public.WebService" />
    <endpoint address="mex" binding="mexHttpsBinding"  bindingConfiguration="mexHttpsBinding1" name="PublicMex"
      contract="IMetadataExchange" />
    <endpoint address="https://myserver1/MyService.web.services/public/xifactoryusers.svc"
      binding="customBinding" bindingConfiguration="customBindingSecure"
      name="PublicXIFactoryUsersHTTPs" contract="MyService.Web.Services.Public.WebService" />
  </service>
</services>

IIS Bindings are good (IIS set to SSL with certificate)

Thanks for any help, Alex

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜