在https站點中訪問我的Web服務期間,我遇到了一個錯誤。 我認爲這是一個配置錯誤,因爲它尋找一個https綁定。如何爲Ajax配置HTTPS和HTTP綁定已啓用WCF Web服務
這裏是Web服務的web.config文件:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service name="WebService.ListViewWebService" behaviorConfiguration="WebService.ListViewWebServiceBehavior">
<endpoint address=""
behaviorConfiguration="WebService.ListViewWebServiceAjaxBehavior"
binding="webHttpBinding"
contract="WebService.IListViewWebService"/>
<endpoint address="https://win-d741qhlbivf:13241/services/DPT/_vti_bin/DPT.WebService/ListViewWebService.svc"
behaviorConfiguration="WebService.ListViewWebServiceAjaxBehavior1"
binding="webHttpsBinding"
contract="WebService.IListViewWebService2"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="webHttpBinding">
<security mode="None" />
</binding>
<binding name="webHttpsBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="WebService.ListViewWebServiceAjaxBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WebService.ListViewWebServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
感謝提前的幫助。
另外,我不知道這有什麼做的問題,而是在雲環境中託管Web應用程序......我需要一個特殊的配置是什麼?...再次
感謝。 。
嗨,謝謝你的回覆。我在你的博客中按照你的步驟,但我得到了同樣的錯誤: – GeekInPurpleAndPink
錯誤是:沒有名爲'WebService.ListViewWebServiceAjaxBehavior1'的終端行爲。 (C:\ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 14 \ isapi \ webservice \ web.config line 11) – GeekInPurpleAndPink
請參閱我的更新,以獲取新的配置:)謝謝 – GeekInPurpleAndPink