Created
July 6, 2017 10:00
-
-
Save clemensv/a35794aea9ba25de1cb01e0cc152fa4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.svc file | |
-------------- | |
<%@ ServiceHost Language="C#" Debug="true" Service="MyService.Service1" %> | |
using System.ServiceModel; | |
namespace MyService | |
{ | |
[ServiceContract] | |
public class Service1 | |
{ | |
[OperationContract] | |
public string GetData(int value) | |
{ | |
return string.Format("You entered: {0}", value); | |
} | |
} | |
} | |
------ | |
Config (4 lines effective WCF config, all autogenerated by VS wizard, ?wsdl is turned on here, endpoint is controlled here) | |
<?xml version="1.0"?> | |
<configuration> | |
<appSettings> | |
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> | |
</appSettings> | |
<system.web> | |
<compilation debug="true" targetFramework="4.5.2" /> | |
<httpRuntime targetFramework="4.5.2"/> | |
</system.web> | |
<system.serviceModel> | |
<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> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment