2012-07-17 82 views
2

我在使用webHttpBinding實現https時遇到問題。我遇到錯誤使用https與webHttpBinding發佈

無法找到與綁定WebHttpBinding的端點匹配scheme https的基地址。註冊的基地址方案是[http:

以下是我的web.config代碼。請幫助

<system.serviceModel> 
<bindings> 
    <webHttpBinding> 
    <binding name="webHttpMobile" maxReceivedMessageSize="2147483647"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" /> 
     </security> 
     <readerQuotas maxStringContentLength="2147483647" /> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<services> 

    <service behaviorConfiguration="mybehavior"   name="SoIn.Services.MobileWebRole.Command"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.ICommand" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Query"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IQuery" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Configuration"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IConfiguration" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 
<behaviors> 
    <endpointBehaviors> 
    <behavior name="web"> 
     <webHttp /> 
    </behavior> 
    </endpointBehaviors> 
    <serviceBehaviors> 
    <behavior name="mybehavior"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    <behavior name=""> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 

+0

你正在收到什麼錯誤信息? – 2012-07-17 11:45:34

回答

-2

嘗試以下提到的配置。

<system.serviceModel> 
<bindings> 
    <webHttpBinding> 
    <binding name="webHttpMobile" maxReceivedMessageSize="2147483647"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
     <readerQuotas maxStringContentLength="2147483647" /> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<services> 

    <service behaviorConfiguration="mybehavior"   name="SoIn.Services.MobileWebRole.Command"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.ICommand" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Query"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IQuery" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
    <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Configuration"> 
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IConfiguration" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 
<behaviors> 
    <endpointBehaviors> 
    <behavior name="web"> 
     <webHttp /> 
    </behavior> 
    </endpointBehaviors> 
    <serviceBehaviors> 
    <behavior name="mybehavior"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    <behavior name=""> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
+0

我複製並粘貼了你所給的,但仍然不工作...現在我得到這個標籤,你有mentoied問題 user1037747 2012-07-17 12:38:07

+0

嘗試安全模式='無' 。它爲我工作。 – Shailesh 2012-07-17 12:39:01

+0

我必須實現mexHttpsBinding和webHttpsBinding嗎? – user1037747 2012-07-17 12:42:43