File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Basic/Binding/Basic/Http/Service Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments