Last change
on this file since 8084 was
6226,
checked in by msammer, 13 years ago
|
#1446 rebuild the shown table. Now it is possible to make a right 'details'-call via an action within the MVC
|
File size:
1.3 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Web;
|
---|
5 | using HLWebOKBQueryPlugin.OKBQueryService;
|
---|
6 | using System.ServiceModel.Security;
|
---|
7 |
|
---|
8 | namespace HLWebOKBQueryPlugin.Helpers
|
---|
9 | {
|
---|
10 | public class Query
|
---|
11 | {
|
---|
12 | public static QueryServiceClient GetClientFactory() {
|
---|
13 | return GetClientFactory(GetSessionString("Username"), GetSessionString("Password"));
|
---|
14 | }
|
---|
15 |
|
---|
16 | public static QueryServiceClient GetClientFactory(string username, string password) {
|
---|
17 | try {
|
---|
18 | QueryServiceClient client = new QueryServiceClient();
|
---|
19 | client.ClientCredentials.UserName.UserName = "okbtester";
|
---|
20 | client.ClientCredentials.UserName.Password = "okbtester";
|
---|
21 | client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
|
---|
22 | client.GetFilters();
|
---|
23 | return client;
|
---|
24 | }
|
---|
25 | catch {
|
---|
26 | }
|
---|
27 | return null;
|
---|
28 | }
|
---|
29 |
|
---|
30 | public static string GetSessionString(string name) {
|
---|
31 | if (name != null) {
|
---|
32 | object o = HttpContext.Current.Session[name];
|
---|
33 | if (o != null) {
|
---|
34 | return o.ToString();
|
---|
35 | }
|
---|
36 | }
|
---|
37 | return string.Empty;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.