Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.ServiceModel;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Services.Authentication
|
---|
8 | {
|
---|
9 | public class ClientFactory
|
---|
10 | {
|
---|
11 |
|
---|
12 | public static T Create<T, I>()
|
---|
13 | where T : ClientBase<I>, I
|
---|
14 | where I : class
|
---|
15 | {
|
---|
16 | var client = Activator.CreateInstance<T>();
|
---|
17 | client.ClientCredentials.UserName.UserName = "Alice";
|
---|
18 | client.ClientCredentials.UserName.Password = "YouWillKnow";
|
---|
19 | client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
|
---|
20 |
|
---|
21 | return client;
|
---|
22 |
|
---|
23 | }
|
---|
24 |
|
---|
25 | }
|
---|
26 |
|
---|
27 | }
|
---|
28 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.