How to make WCF Services compatible with HTTP Requests
WCF Services compatibility Guide
Introduction
A simple example
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MyService
{ββββ
[OperationContract]
public string DoWork()
{ββββ
return "Dummy string";
}ββββ
}<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="SimpleSLApp.Web.MyService.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<services>
<service name="SimpleSLApp.Web.MyService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="SimpleSLApp.Web.MyService.customBinding0"
contract="SimpleSLApp.Web.MyService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>Step #1: Change service configuration
Step #2 Add attributes to identify web operations
Using the service
When to use POST
Enabling CORS on WCF
PreviousHow to Modify StylesNextHow to integrate a new service method into the Angular migrated application
Last updated
Was this helpful?