senpost
2/17/2012 - 2:43 PM

web.config with SOAP and REST endpoints

web.config with SOAP and REST endpoints

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>

  <system.serviceModel>

    <services>
      <service name="SoapAndRestService.HelloService" behaviorConfiguration="HelloServiceBehavior" >
        <endpoint address="" binding="basicHttpBinding" contract="SoapAndRestService.IHelloService"/>

        <endpoint address="rest" binding="webHttpBinding" behaviorConfiguration="restEndpointBehaviors" contract="SoapAndRestService.IHelloService"/>
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="HelloServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>

      <endpointBehaviors>
        <behavior name="restEndpointBehaviors">
          <webHttp />
        </behavior>
      </endpointBehaviors>

    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>