Skip to content

Commit 111d2d6

Browse files
authored
Update WCF sample - NetTcp Default client code (#6270)
1 parent b0e7503 commit 111d2d6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

framework/wcf/Basic/Binding/Net/Tcp/Default/CS/client/client.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@
33
//----------------------------------------------------------------
44

55
using System;
6+
using System.ServiceModel;
67

78
namespace Microsoft.Samples.NetTcp
89
{
9-
//The service contract is defined in generatedClient.cs, generated from the service by the svcutil tool.
10+
// The service contract is defined in generatedClient.cs, generated from the service by the svcutil tool.
1011

11-
//Client implementation code.
12+
// Client implementation code.
1213
class Client
1314
{
1415
static void Main()
1516
{
1617
// Create a client
1718
CalculatorClient client = new CalculatorClient();
1819

20+
// Include the identity element when running cross-machine in a domain.
21+
// NetTcpBinding binding = new NetTcpBinding();
22+
// var endpointIdentity = new UpnEndpointIdentity("user_name@service_domain");
23+
// EndpointAddress endpointAddress = new EndpointAddress(new Uri("net.tcp://localhost:9000/servicemodelsamples/service"), endpointIdentity);
24+
// CalculatorClient client = new CalculatorClient(binding, endpointAddress);
25+
1926
// Call the Add service operation.
2027
double value1 = 100.00D;
2128
double value2 = 15.99D;

framework/wcf/Basic/Binding/Net/Tcp/Default/CS/client/client.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
25+
<Reference Include="System.IdentityModel" />
2526
<Reference Include="System.ServiceModel" />
2627
</ItemGroup>
2728

@@ -31,4 +32,3 @@
3132
</ItemGroup>
3233

3334
</Project>
34-

0 commit comments

Comments
 (0)