-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (30 loc) · 975 Bytes
/
Program.cs
File metadata and controls
31 lines (30 loc) · 975 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NETCoreService;
using System.Text;
namespace NETCoreWCFClient
{
public class Program
{
public static void Main(string[] args)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
NETCoreServiceClient client = new NETCoreServiceClient();
var t = client.GetDataAsync(100);
Console.WriteLine(t.Result);
var t1 = client.GetListAsync();
foreach (var item in t1.Result)
{
Console.WriteLine(item);
}
CompositeType composite = new CompositeType();
composite.BoolValue = true;
composite.StringValue = "客户端调用";
var t2 = client.GetDataUsingDataContractAsync(composite);
Console.WriteLine(t2.Result.StringValue);
Console.ReadKey();
}
}
}