2015-12-11 161 views
1
<?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測試客戶端的幫助下,我獲得了所需的輸出。 但是,當我把dlls & web.config在我主持它拋出一個錯誤 "Could not find a base address that matches scheme HTTP for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]"https https web服務錯誤

可以在任何一個告訴我上述錯誤的原因是什麼服務的服務器?我的網絡服務的一般流程 應用程序 - >服務器託管(calc.svc) - > https://******.****- */***** _ ***** ?SOAP(已驗證) 當我添加服務引用app.config時,生成了默認basichttpbinding被添加到app.config文件。 根據我的理解,web.config文件用於託管iis服務&我認爲我的web.config是錯誤的。 在客戶端點中,應該是calc.svc還是https:// *?soap的結束點? 網址https://prd36/calc.svc的網址是否正確? 我是否需要爲應用程序另外指定一個綁定? 請幫我理解我很困惑,因爲我編輯的web.config是現有的仍然運行舊的服務引用。

回答

0

在您的端點地址中使用http://而不是https://。 或 用戶BasicHttpsBinding而不是BasicHttpBinding在您的端點。

關注this link如果問題仍然存在。

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

上面的變化我做了,服務的URL在Web瀏覽器中運行。