簡體   English   中英

HTTPS WCF Web服務錯誤

[英]Https wcf webservice Error

<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<endpointBehaviors>
<behavior name="webHttp">
  <webHttp />
 </behavior>
 <behavior name="webHttpBehavior">
 <webHttp />
 </behavior></endpointBehaviors>
     </behaviors>
  <services>
  <service name="Implementation.Service" behaviorConfiguration="serviceBehavior">
  <endpoint address="" binding="basicHttpBinding"   contract="Contract.IService" behaviorConfiguration="web"    bindingConfiguration="basicHttpBinding"></endpoint>
 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  </services>
  <bindings>
  <basicHttpBinding>
   <binding name="CodeItSoap" closeTimeout="00:01:00">
   <security mode="Transport">
   <transport clientCredentialType="Basic" proxyCredentialType ="Basic"  realm =" "/>
 <message clientCredentialType= "username" algorithm ="default">
  </security>
 </binding>
 </basicHttpBinding>
 </bindings>
  <client>
 <endpoint address="https://******.****-***/*****_*****?SOAP"
  binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
 contract="Service.CodeItSoap" name="CodeItSoap" />
</client>
 </system.serviceModel>
 </configuration>

這只是我的web.config文件的一個示例。 當我在本地主機中運行該服務時,它運行良好,並且在wcf測試客戶端的幫助下,我獲得了所需的輸出。 但是,當我將dllsweb.config放入必須托管服務的服務器中時,它會引發錯誤"Could not find a base address that matches scheme HTTP for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]"

誰能告訴我上述錯誤的原因是什么? 我的Web服務應用程序的一般流程->服務器托管(calc.svc)-> https://******.****- * / ***** _ *****?SOAP(已驗證),當我添加服務引用app.config時就已生成,並且默認情況下basichttpbinding已添加到app.config文件中。 根據我的理解,web.config文件用於在iis中托管服務,我認為我的web.config是錯誤的。 在客戶端端點中,calc.svc或https:// * ?soap 的端點應該是什么 https://prd36/calc.svc url的basichttpbinding可以嗎? 我是否還需要為應用程序指定一個綁定? 請幫助我了解我非常困惑,因為我編輯的web.config是一個仍在運行舊服務參考的現有配置。

 <serviceMetadata httpsGetEnabled="true"/> 
 <endpoint address="json" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web"></endpoint> 
 <endpoint address="mex" binding="mexHttpsinding" contract="IMetadataExchange"/>

以上我所做的更改和服務URL在Web瀏覽器中運行。

在端點地址中使用http://而不是https:// 或在端點中使用User BasicHttpsBinding而不是BasicHttpBinding

如果問題仍然存在,請單擊此鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM