简体   繁体   中英

WCF Basichttpbinding web.config example for REST API

I tried to find web.config for my WCF service connect to server using REST call. However, its saying unable to connect server. Here is my 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> 

Could anyone please help me, how can I correct this? I tried on net, however, not able to find any suitable tutorial for this. Please help.

This is resolved. Its was a proxy issue and after adding proxy to browser and IIS the issue got resolved. Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM