簡體   English   中英

REST API的WCF Basichttpbinding web.config示例

[英]WCF Basichttpbinding web.config example for REST API

我試圖找到WCF服務的web.config,並使用REST調用連接到服務器。 但是,它的說法無法連接服務器。 這是我的web.config:

 <?xml version="1.0"?> <configuration> <!--<system.net> <defaultProxy useDefaultCredentials="true" > </defaultProxy> </system.net>--> <appSettings> <add key="UserName" value="admin"/> <add key="Password" value="admin"/> <add key="resturl" value="https://Clientname.atlassian.net/rest/api/2/"/> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5"/> </system.web> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IJiraService"/> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:19065/JiraService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IJiraService" contract="ServiceReference1.IJiraService" name="BasicHttpBinding_IJiraService" /> </client> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the values below to false before deployment --> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <!-- To browse web app root directory during debugging, set the value below to true. Set to false before deployment to avoid disclosing web app folder information. --> <directoryBrowse enabled="true"/> </system.webServer> </configuration> 

誰能幫我,我該如何糾正? 我在網上嘗試過,但是無法為此找到任何合適的教程。 請幫忙。

解決了。 這是一個代理問題,將代理添加到瀏覽器和IIS后,此問題得到解決。 謝謝。

暫無
暫無

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

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