-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProgram.cs
More file actions
73 lines (65 loc) · 2.58 KB
/
Copy pathProgram.cs
File metadata and controls
73 lines (65 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Craig Nicholson">
// MIT
// </copyright>
// <summary>
// Defines the Program type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace SoapLoggingExample
{
using System;
using System.Diagnostics;
using System.Net;
/// <summary>
/// Example program to demonstrate capturing a soap request and response.
/// </summary>
public class Program
{
/// <summary>
/// The logger we will use to log transactions to help with debugging.
/// </summary>
private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Main entry point of the program.
/// </summary>
/// <param name="args">
/// The args.
/// </param>
public static void Main(string[] args)
{
Logger.Info("Enter");
Logger.Info("CallWebService Starting");
CallWebService();
Logger.Info("CallWebService Done");
Console.ReadLine();
}
/// <summary>
/// Call your own web service. This example is for MultiSpeak Standard.
/// </summary>
private static void CallWebService()
{
var stopwatch = new Stopwatch();
stopwatch.Start();
// Ask MilSoft for the data via a MultiSpeak web request
var client = new OA_Server.OA_Server { Url = "http://10.86.1.31/Simulators/MultiSpeak/30ac/OA_Server.asmx" };
var messageId = Guid.NewGuid();
var header = new OA_Server.MultiSpeakMsgHeader
{
UserID = "User123",
Pwd = "***********",
AppName = "TestApp",
AppVersion = "0",
Company = "ElectSolve",
Version = "3.0ac",
MessageID = messageId.ToString(),
TimeStamp = DateTime.Now,
TimeStampSpecified = true
};
client.MultiSpeakMsgHeaderValue = header;
// self-signed cert override when TLS is enabled with self signed cert this code block ignores the warnings.
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var response = client.GetOutageDurationEvents("2017-10-27-0003");
}
}
}