2
using System.Collections.Generic;
6
using System.Web.UI.WebControls;
7
using System.ServiceModel;
13
public partial class _Default : System.Web.UI.Page
15
private TrojaServiceReference.TrojaWcfClient proxy = new TrojaServiceReference.TrojaWcfClient();
17
protected void Page_Load(object sender, EventArgs e)
19
//proxy.PreAuthenticate = true;
20
//proxy.Credentials = CredentialCache.DefaultCredentials;
21
ServiceUrl.Text = proxy.Endpoint.Address.Uri.AbsoluteUri;
24
//protected void Button1_Click(object sender, EventArgs e)
26
// proxy.PreAuthenticate = true;
27
// proxy.Credentials = CredentialCache.DefaultCredentials;
29
// //TrojaService.TrojaWcfClient service = new TrojaService.TrojaWcfClient();
30
// //CalculatorService.CalculatorClient service = new CalculatorService.CalculatorClient();
31
// //service.Endpoint.Address = new EndpointAddress(TextBox1.Text);
32
// //Label.Text = proxy.ServiceUser() + " - " + proxy.WhoAmI();
34
// //RegistryKey key = Registry.CurrentUser.
37
protected void SetUrl_Click(object sender, EventArgs e)
39
proxy.Endpoint.Address = new EndpointAddress(ServiceUrl.Text);
42
protected void FetchCaller_Click(object sender, EventArgs e)
44
Caller.Text = proxy.WhoAmI();
47
protected void FetchServiceUser_Click(object sender, EventArgs e)
49
ServiceUser.Text = proxy.ServiceUser();
52
protected void GetCommands_Click(object sender, EventArgs e)
54
//Commands.Text = proxy.GetCommands();
55
Guid id = proxy.CreateCommand("ping", "google.dk", false, new TimeSpan(0, 5, 0), "");
56
Commands.Text = id.ToString();
62
//public TrojaWS this[string host]
66
// if (!proxies.ContainsKey(host))
68
// TrojaWS proxy = new TrojaWS();
69
// proxy.Url = string.Format(@"http://{0}:{1}/TrojaWS.asmx", host, ConfigurationSettings.AppSettings["troja_tcp_port"]);
70
// proxy.PreAuthenticate = true;
71
// proxy.Credentials = CredentialCache.DefaultCredentials;
73
// proxies[host] = proxy;
76
// return proxies[host];
b'\\ No newline at end of file'