Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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