markus / ConvertService / ServiceBase / WcfCheck / Program.cs @ 43e1d368
이력 | 보기 | 이력해설 | 다운로드 (1.41 KB)
1 | 53c9637d | taeseongkim | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.ServiceModel; |
||
5 | using System.Text; |
||
6 | using System.Threading.Tasks; |
||
7 | using System.Timers; |
||
8 | |||
9 | namespace WcfCheck |
||
10 | { |
||
11 | class Program |
||
12 | { |
||
13 | static void Main(string[] args) |
||
14 | { |
||
15 | if (args?.Count() > 0) |
||
16 | { |
||
17 | var serviceUri = args[0]; |
||
18 | BasicHttpBinding myBinding = new BasicHttpBinding(); |
||
19 | EndpointAddress myEndpoint = new EndpointAddress(serviceUri); |
||
20 | |||
21 | stationServiceClient = new StationService.StationServiceClient(myBinding, myEndpoint); |
||
22 | |||
23 | timer = new System.Timers.Timer(new TimeSpan(0, 0, 0, 1).TotalMilliseconds); |
||
24 | timer.Elapsed += OnTimedEvent; |
||
25 | timer.AutoReset = true; |
||
26 | timer.Start(); |
||
27 | Console.Read(); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | private static void OnTimedEvent(object sender, ElapsedEventArgs e) |
||
32 | { |
||
33 | timer.Stop(); |
||
34 | |||
35 | var items = stationServiceClient.AliveConvertList (); |
||
36 | |||
37 | foreach (var item in items) |
||
38 | { |
||
39 | Console.WriteLine($"convert ID : {item.ConvertID} project No : {item.ProjectNumber} pdf : {item.OriginfilePath} save : {item.ConvertPath} "); |
||
40 | } |
||
41 | |||
42 | timer.Start(); |
||
43 | } |
||
44 | |||
45 | static StationService.StationServiceClient stationServiceClient; |
||
46 | static System.Timers.Timer timer; |
||
47 | } |
||
48 | } |