File tree 4 files changed +10
-13
lines changed
4 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 33
33
</PropertyGroup >
34
34
<ItemGroup >
35
35
<Reference Include =" System" />
36
- <Reference Include =" System.Core" />
37
- <Reference Include =" System.IdentityModel" />
38
36
<Reference Include =" System.ServiceModel" />
39
- <Reference Include =" System.Xml.Linq" />
40
- <Reference Include =" System.Data.DataSetExtensions" />
41
- <Reference Include =" Microsoft.CSharp" />
42
- <Reference Include =" System.Data" />
43
- <Reference Include =" System.Xml" />
44
37
</ItemGroup >
45
38
<ItemGroup >
46
39
<Compile Include =" Program.cs" />
Original file line number Diff line number Diff line change @@ -14,11 +14,15 @@ static void Main(string[] args)
14
14
15
15
var address = new EndpointAddress ( new Uri ( string . Format ( "https://{0}:9000/MyService" , hostAddress ) ) ) ;
16
16
var binding = new BasicHttpsBinding ( BasicHttpsSecurityMode . TransportWithMessageCredential ) ;
17
-
18
17
var factory = new ChannelFactory < IWcfService > ( binding , address ) ;
19
- factory . Credentials . UserName . UserName = "myUser" ;
20
- factory . Credentials . UserName . Password = "myPassword" ;
21
- //factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
18
+
19
+ Console . Write ( "Enter username: " ) ;
20
+ var username = Console . ReadLine ( ) ;
21
+ factory . Credentials . UserName . UserName = username ;
22
+
23
+ Console . Write ( "Enter password: " ) ;
24
+ var password = Console . ReadLine ( ) ;
25
+ factory . Credentials . UserName . Password = password ;
22
26
23
27
IWcfService host = factory . CreateChannel ( ) ;
24
28
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ static void Main(string[] args)
17
17
18
18
host . Credentials . UserNameAuthentication . UserNamePasswordValidationMode = UserNamePasswordValidationMode . Custom ;
19
19
host . Credentials . UserNameAuthentication . CustomUserNamePasswordValidator = new CredentialsValidator ( ) ;
20
- //host.Credentials.ServiceCertificate.Certificate. = X509CertificateValidationMode.None;
21
20
22
21
// Attach a Certificate from the Certificate Store to the HTTP Binding
23
22
string certThumbprint = "a5394ac183ef41da4ac99856de426087267e9f64" ;
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ public class WcfService : IWcfService
6
6
{
7
7
public string Echo ( string input )
8
8
{
9
- return String . Format ( "You've entered: {0}" , input ) ;
9
+ Console . WriteLine ( "Received from client: {0}" , input ) ;
10
+ return input ;
10
11
}
11
12
}
12
13
}
You can’t perform that action at this time.
0 commit comments