daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace WcfWebHttpIISHostingSample
  2. {
  3.     [ServiceContract]
  4.     interface ITestService
  5.     {
  6.         [OperationContract]
  7.         string GetData(string data);
  8.     }
  9.     public class ServiceTest : ITestService
  10.     {
  11.         public string GetData(string data)
  12.         {
  13.             return "OK";
  14.         }
  15.     }
  16. }
  17.    
  18. <system.serviceModel>
  19.   <bindings>
  20.     <basicHttpBinding>
  21.       <binding name="UsernameWithTransportCredentialOnly">
  22.         <security mode="TransportCredentialOnly">
  23.           <transport clientCredentialType="Basic"/>
  24.         </security>
  25.       </binding>
  26.     </basicHttpBinding>
  27.   </bindings>
  28.  
  29.   <behaviors>
  30.     <serviceBehaviors>
  31.       <behavior name="ServiceWithMetaData">
  32.         <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
  33.         <serviceDebug includeExceptionDetailInFaults="false" />
  34.       </behavior>
  35.     </serviceBehaviors>
  36.   </behaviors>
  37.  
  38.   <services>
  39.     <service name="WcfWebHttpIISHostingSample.ServiceTest" behaviorConfiguration="ServiceWithMetaData">
  40.       <endpoint
  41.         address="http://localhost:17625/ServiceTest.svc"
  42.         binding="basicHttpBinding"
  43.         bindingConfiguration="UsernameWithTransportCredentialOnly"
  44.         name="BasicEndpoint"
  45.         contract="WcfWebHttpIISHostingSample.ITestService">
  46.       </endpoint>
  47.     </service>
  48.   </services>
  49.  
  50.   <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
  51.       multipleSiteBindingsEnabled="false" />
  52. </system.serviceModel>
RAW Paste Data
Top