Skip to content

Commit 2194063

Browse files
committed
fix issue
1 parent e30ee89 commit 2194063

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using CoreWCF;
2+
using CoreWCF.Configuration;
3+
using Microsoft.AspNetCore.Builder;
4+
using Microsoft.Extensions.DependencyInjection;
5+
6+
namespace CoreWcf.Samples.Http
7+
{
8+
public class BasicHttpBindingStartup
9+
{
10+
public void ConfigureServices(IServiceCollection services)
11+
{
12+
//Enable CoreWCF Services, with metadata (WSDL) support
13+
services.AddServiceModelServices()
14+
.AddServiceModelMetadata();
15+
}
16+
17+
public void Configure(IApplicationBuilder app)
18+
{
19+
app.UseServiceModel(builder =>
20+
{
21+
// Add the Calculator Service
22+
builder.AddService<CalculatorService>(serviceOptions => { })
23+
// Add BasicHttpBinding endpoint
24+
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new BasicHttpBinding(), "/CalculatorService/basicHttp");
25+
26+
// Configure WSDL to be available
27+
var serviceMetadataBehavior = app.ApplicationServices.GetRequiredService<CoreWCF.Description.ServiceMetadataBehavior>();
28+
serviceMetadataBehavior.HttpGetEnabled = true;
29+
});
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)