Skip to content

Instantly share code, notes, and snippets.

@kirillkrylov
Last active September 16, 2022 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirillkrylov/d76b63825122915005ccf683a369b97b to your computer and use it in GitHub Desktop.
Save kirillkrylov/d76b63825122915005ccf683a369b97b to your computer and use it in GitHub Desktop.
Configuration Example

To configure anonymous services follow academy article

  1. Register the custom web service Go to the ..\Terrasoft.WebApp\ServiceModel directory. Create a DlbSmsService.svc file and add the following record to it.
<% @ServiceHost Language="C#" Debug="true" Service="DlbSmsConnector.DlbSmsService" %>
  1. Enable both HTTP and HTTPS support Open the ..\Terrasoft.WebApp\ServiceModel\http\services.config file and add the following record to it.
<service name="DlbSmsConnector.DlbSmsService">
	<endpoint name="DlbSmsServiceEndPoint"
		address=""
		binding="webHttpBinding"
		behaviorConfiguration="RestServiceBehavior"
		bindingNamespace="http://Terrasoft.WebApp.ServiceModel"
		contract="DlbSmsConnector.DlbSmsService" />
</service>
  1. Enable all users to access the custom web service that uses anonymous authentication.
  • Open the ..\Terrasoft.WebApp\Web.config file.
  • Add the element that defines the relative path and access permissions to the web service.
<location path="ServiceModel/DlbSmsService.svc">
	<system.web>
		<authorization>
			<allow users="*" />
		</authorization>
	</system.web>
</location>
  • Add the relative web service path to the value attribute of the AllowedLocations key in the element
<configuration>
...
	<appSettings>
	...
		<add key="AllowedLocations" value="[Previous values];ServiceModel/DlbSmsService.svc"/>
	...
	</appSettings>
...
</configuration>

Make sure to restart IIS appPool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment