![](/img/trans.png)
[英]Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]
[英]Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding
我在我的本地計算機上進行了用戶名/密碼驗證,使用自簽名證書,一切正常,但是當我將我的應用程序放在IIS 7.5和Windows Server 2008 R2上時,它給了我錯誤:
找不到與綁定WSHttpBinding的端點的scheme http匹配的基址。 注冊的基地址方案是[https]。 我的網絡服務cfg:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceCredentialsBehavior">
<serviceCredentials>
<serviceCertificate findValue="cn=AmicCert" storeName="Root" storeLocation="LocalMachine" />
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Util.CustomUserNameValidator, Util" />
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceCredentialsBehavior" name="Service">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="MessageAndUserName" name="SecuredByTransportEndpoint" contract="IService" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="MessageAndUserName">
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client />
</system.serviceModel>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>
聽起來您托管的IIS網站實例僅配置為HTTPS(SSL)。 右鍵單擊網站實例,然后選擇“編輯綁定...”。 你看到那里列出了端口80(普通HTTP)嗎? 同時檢查“SSL設置”功能,確保未啟用“始終需要”選項。
如果您不想為端點使用HTTPS / SSL,則Drew的答案是正確的。
如果您確實想在端點上使用SSL,則需要更改以下內容:
<security mode="Message">
至:
<security mode="TransportWithMessageCredential">
要使其工作並且仍然要求IIS需要SSL,您需要在配置文件中對端點進行一些更改:使用https( https://...
)和listenUri
屬性將address
屬性設置為服務的地址使用http( http://...
)訪問服務的地址。 這適用於wsHttp
和basicHttp
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.