Skip to content

Commit bae0e73

Browse files
committed
update service code
1 parent 874a0d0 commit bae0e73

File tree

5 files changed

+68
-40
lines changed

5 files changed

+68
-40
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
#if NET
6+
7+
using CoreWCF;
8+
using CoreWCF.Channels;
9+
10+
namespace WcfService
11+
{
12+
//public enum BasicHttpsSecurityMode
13+
//{
14+
// //
15+
// // Summary:
16+
// // The Transport security mode.
17+
// Transport,
18+
// //
19+
// // Summary:
20+
// // The TransportWithMessageCredential security mode.
21+
// TransportWithMessageCredential
22+
//}
23+
24+
// Cast BasicHttpsSecurityMode (WCF) to BasicHttpSecurityMode (CoreWCF)
25+
//internal enum BasicHttpsSecurityMode
26+
//{
27+
// None,
28+
// Transport,
29+
// Message,
30+
// TransportWithMessageCredential,
31+
// TransportCredentialOnly
32+
//}
33+
34+
internal class NetHttpsBinding : NetHttpBinding
35+
{
36+
public NetHttpsBinding() : base((BasicHttpSecurityMode)BasicHttpsSecurityMode.Transport)
37+
{
38+
}
39+
40+
public NetHttpsBinding(BasicHttpsSecurityMode securityMode) : base((BasicHttpSecurityMode)securityMode)
41+
{
42+
}
43+
}
44+
}
45+
#endif

src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpDefaultResourceTestServiceHost.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ protected override IList<Binding> GetBindings()
2222
{
2323
var bindings = new List<Binding>();
2424
bindings.Add(GetNetTcpBinding());
25+
26+
#if !NET
2527
if (!HostingEnvironment.IsHosted)
2628
{
2729
bindings.Add(GetNetNamedPipeBinding());
2830
}
29-
31+
#endif
3032
return bindings;
3133
}
3234

@@ -35,10 +37,12 @@ private Binding GetNetTcpBinding()
3537
return new NetTcpBinding() { Name = "tcp-default" };
3638
}
3739

40+
#if !NET
3841
private Binding GetNetNamedPipeBinding()
3942
{
4043
return new NetNamedPipeBinding() { Name = "namedpipe-default" };
4144
}
45+
#endif
4246

4347
public TcpDefaultResourceTestServiceHost(params Uri[] baseAddresses)
4448
: base(typeof(WcfService), baseAddresses)

src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TcpNoSecurityTestServiceHost.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ protected override IList<Binding> GetBindings()
2222
{
2323
var bindings = new List<Binding>();
2424
bindings.Add(GetNetTcpBinding());
25+
26+
#if !NET
2527
if (!HostingEnvironment.IsHosted)
2628
{
2729
bindings.Add(GetNetNamedPipeBinding());
2830
}
29-
31+
#endif
3032
return bindings;
3133
}
3234

@@ -35,10 +37,12 @@ private Binding GetNetTcpBinding()
3537
return new NetTcpBinding(SecurityMode.None) { Name = "tcp-nosecurity" };
3638
}
3739

40+
#if !NET
3841
private Binding GetNetNamedPipeBinding()
3942
{
4043
return new NetNamedPipeBinding(NetNamedPipeSecurityMode.None) { Name = "namedpipe-nosecurity" };
4144
}
45+
#endif
4246

4347
public TcpNoSecurityTestServiceHost(params Uri[] baseAddresses)
4448
: base(typeof(WcfService), baseAddresses)

src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/TestHostWebServiceHost.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NET
6-
using CoreWCF;
7-
#else
5+
#if !NET
86
using System;
97
using System.ServiceModel;
108
using System.ServiceModel.Activation;
119
using System.ServiceModel.Web;
12-
#endif
1310

1411
namespace WcfService
1512
{
@@ -31,3 +28,4 @@ public TestHostWebServiceHost(Type serviceType, params Uri[] baseAddresses)
3128
}
3229
}
3330
}
31+
#endif

src/System.Private.ServiceModel/tools/SelfHostedCoreWcfService/SelfHostedCoreWCFService.csproj

+11-34
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<IsPackable>false</IsPackable>
66
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
77
</PropertyGroup>
8-
8+
99
<ItemGroup>
1010
<Using Include="System.Runtime.Serialization" />
1111
<Using Include="Microsoft.Extensions.DependencyInjection.Extensions" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="CoreWCF.Http" Version="1.5.0-wsrs.1.g14d7d00798" />
15-
<PackageReference Include="CoreWCF.NetTcp" Version="1.5.0-wsrs.1.g14d7d00798" />
16-
<PackageReference Include="CoreWCF.Primitives" Version="1.5.0-wsrs.1.g14d7d00798" />
17-
<PackageReference Include="CoreWCF.WebHttp" Version="1.5.0-wsrs.1.g14d7d00798" />
18-
<PackageReference Include="idunno.Authentication.Basic" Version="2.3.1" />
14+
<PackageReference Include="CoreWCF.Http" Version="1.6" />
15+
<PackageReference Include="CoreWCF.NetTcp" Version="1.6" />
16+
<PackageReference Include="CoreWCF.Primitives" Version="1.6" />
17+
<PackageReference Include="CoreWCF.WebHttp" Version="1.6" />
18+
<PackageReference Include="idunno.Authentication.Basic" Version="2.4.0" />
1919
</ItemGroup>
2020
<ItemGroup>
2121
<Compile Include="..\IISHostedWcfService\**\*.cs">
@@ -24,52 +24,29 @@
2424
</Compile>
2525
</ItemGroup>
2626
<ItemGroup>
27-
<Compile Remove="..\IISHostedWcfService\App_code\ISessionTests.cs" />
28-
<Compile Remove="..\IISHostedWcfService\App_code\IVerifyWebSockets.cs" />
29-
<Compile Remove="..\IISHostedWcfService\App_code\SessionTestsService.cs" />
30-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\DuplexTestServiceHosts.cs" />
3127
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Federation\AcceptAnyUsernameSecurityTokenHandler.cs" />
3228
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Federation\FederationSTSServiceHost.cs" />
3329
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Federation\ReturnX509SubjectNameOrRSAIssuerNameRegistry.cs" />
3430
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Federation\SelfHostSecurityTokenService.cs" />
35-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsClientCertificateTestServiceHost.cs" />
36-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
37-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
38-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\NetHttpsTestServiceHost.cs" />
39-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\NetHttpTestServiceHost.cs" />
4031
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\ReliableSessionDuplexTestServiceHost.cs" />
4132
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\ReliableSessionOneWayTestServiceHost.cs" />
4233
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\ReliableSessionTestServiceHost.cs" />
4334
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\Saml2IssuedTokenTestServiceHost.cs" />
44-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TcpDefaultResourceTestServiceHost.cs" />
45-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TcpNoSecurityTestServiceHost.cs" />
46-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TcpSessionTestServiceHost.cs" />
35+
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
36+
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
4737
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\TestHostWebServiceHost.cs" />
48-
<Compile Remove="..\IISHostedWcfService\App_code\testhosts\WebSocketTestServiceHosts.cs" />
49-
<Compile Remove="..\IISHostedWcfService\App_code\VerifyWebSockets.cs" />
50-
<None Include="..\IISHostedWcfService\App_code\ISessionTests.cs" />
51-
<None Include="..\IISHostedWcfService\App_code\IVerifyWebSockets.cs" />
52-
<None Include="..\IISHostedWcfService\App_code\SessionTestsService.cs" />
53-
<None Include="..\IISHostedWcfService\App_code\testhosts\DuplexTestServiceHosts.cs" />
38+
5439
<None Include="..\IISHostedWcfService\App_code\testhosts\Federation\AcceptAnyUsernameSecurityTokenHandler.cs" />
5540
<None Include="..\IISHostedWcfService\App_code\testhosts\Federation\FederationSTSServiceHost.cs" />
5641
<None Include="..\IISHostedWcfService\App_code\testhosts\Federation\ReturnX509SubjectNameOrRSAIssuerNameRegistry.cs" />
5742
<None Include="..\IISHostedWcfService\App_code\testhosts\Federation\SelfHostSecurityTokenService.cs" />
58-
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsClientCertificateTestServiceHost.cs" />
59-
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
60-
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
61-
<None Include="..\IISHostedWcfService\App_code\testhosts\NetHttpsTestServiceHost.cs" />
62-
<None Include="..\IISHostedWcfService\App_code\testhosts\NetHttpTestServiceHost.cs" />
6343
<None Include="..\IISHostedWcfService\App_code\testhosts\ReliableSessionDuplexTestServiceHost.cs" />
6444
<None Include="..\IISHostedWcfService\App_code\testhosts\ReliableSessionOneWayTestServiceHost.cs" />
6545
<None Include="..\IISHostedWcfService\App_code\testhosts\ReliableSessionTestServiceHost.cs" />
6646
<None Include="..\IISHostedWcfService\App_code\testhosts\Saml2IssuedTokenTestServiceHost.cs" />
67-
<None Include="..\IISHostedWcfService\App_code\testhosts\TcpDefaultResourceTestServiceHost.cs" />
68-
<None Include="..\IISHostedWcfService\App_code\testhosts\TcpNoSecurityTestServiceHost.cs" />
69-
<None Include="..\IISHostedWcfService\App_code\testhosts\TcpSessionTestServiceHost.cs" />
47+
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsCertTestServiceHost.cs" />
48+
<None Include="..\IISHostedWcfService\App_code\testhosts\HttpsTransportSecurityMessageCredentialsUsernameTestServiceHost.cs" />
7049
<None Include="..\IISHostedWcfService\App_code\testhosts\TestHostWebServiceHost.cs" />
71-
<None Include="..\IISHostedWcfService\App_code\testhosts\WebSocketTestServiceHosts.cs" />
72-
<None Include="..\IISHostedWcfService\App_code\VerifyWebSockets.cs" />
7350
</ItemGroup>
7451
<ItemGroup>
7552
<None Include="..\IISHostedWcfService\Web.config">

0 commit comments

Comments
 (0)