Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
- public void MyOperation(int arg)
- <behavior name="ReceivingServiceBehavior">
- <!-- Other behaviors -->
- <serviceAuthorization impersonateCallerForAllOperations="true" />
- </behavior>
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <system.serviceModel>
- <!-- .... -->
- <behaviors>
- <endpointBehaviors>
- <behavior name="ImpersonationBehavior">
- <clientCredentials>
- <windows allowedImpersonationLevel="Impersonation" />
- </clientCredentials>
- </behavior>
- </endpointBehaviors>
- </behaviors>
- </system.serviceModel>
- </configuration>
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <system.serviceModel>
- <!-- .... -->
- <behaviors>
- <endpointBehaviors>
- <behavior name="ImpersonationBehavior">
- <clientCredentials>
- <windows allowedImpersonationLevel="Impersonation" />
- </clientCredentials>
- </behavior>
- </endpointBehaviors>
- </behaviors>
- </system.serviceModel>
- </configuration>
- <system.serviceModel>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
- <services>
- <service behaviorConfiguration="SymitarService.ScheduleServiceBehavior" name="SymitarService.ScheduleService">
- <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsSecure" contract="SymitarService.IScheduleService">
- <identity>
- <dns value="localhost" />
- </identity>
- </endpoint>
- <endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="wsSecure" contract="IMetadataExchange" />
- </service>
- </services>
- <behaviors>
- <serviceBehaviors>
- <behavior name="SymitarService.UserDirectoryBehavior">
- <serviceMetadata httpGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="true" />
- <serviceAuthorization impersonateCallerForAllOperations="true" />
- </behavior>
- <behavior name="SymitarService.ScheduleServiceBehavior">
- <serviceMetadata httpGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="true" />
- <serviceAuthorization impersonateCallerForAllOperations="true" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- <bindings>
- <netTcpBinding>
- <binding name="tcpSecure" portSharingEnabled="true" />
- </netTcpBinding>
- <wsHttpBinding>
- <binding name="wsSecure" allowCookies="true">
- <security mode="Transport">
- <transport clientCredentialType="Windows" proxyCredentialType="Windows" />
- <message clientCredentialType="Windows" negotiateServiceCredential="true" />
- </security>
- </binding>
- </wsHttpBinding>
- <mexTcpBinding>
- <binding name="mexSecure" />
- </mexTcpBinding>
- </bindings>
- </system.serviceModel>
- <system.serviceModel>
- <bindings>
- <wsHttpBinding>
- <binding name="WSHttpBinding_IScheduleService" closeTimeout="01:00:00" openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" useDefaultWebProxy="true" allowCookies="true">
- <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
- <reliableSession ordered="true" inactivityTimeout="00:20:00" enabled="false" />
- <security mode="Transport">
- <transport clientCredentialType="Windows" proxyCredentialType="Windows" realm="" />
- <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
- </security>
- </binding>
- </wsHttpBinding>
- </bindings>
- <behaviors>
- <endpointBehaviors>
- <behavior name="ImpersonationBehavior">
- <clientCredentials>
- <windows allowedImpersonationLevel="Impersonation" allowNtlm="true"/>
- </clientCredentials>
- </behavior>
- </endpointBehaviors>
- </behaviors>
- <client>
- <endpoint address="https://server:444/SymitarService/ScheduleService.svc"
- binding="wsHttpBinding"
- bindingConfiguration="WSHttpBinding_IScheduleService"
- contract="Symitar.ScheduleService.IScheduleService"
- name="WSHttpBinding_IScheduleService"
- behaviorConfiguration="ImpersonationBehavior"
- >
- <identity>
- <dns value="localhost" />
- </identity>
- </endpoint>
- </client>
- </system.serviceModel>
- [OperationBehavior(Impersonation:=ImpersonationOption.Required)]
Add Comment
Please, Sign In to add comment