Skip to content

Commit d2ee854

Browse files
committed
update service enpoints
1 parent 5e46882 commit d2ee854

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Basic/Services/Hosting/WindowsService/Client/Connected Services/CoreWcf.Samples.WindowsService/ConnectedService.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"ExtendedData": {
33
"inputs": [
4-
"http://localhost:5000/CalculatorService/basicService"
4+
"http://localhost:5000/CalculatorService"
55
],
66
"collectionTypes": [
77
"System.Array",

Basic/Services/Hosting/WindowsService/Client/Connected Services/CoreWcf.Samples.WindowsService/Reference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointCo
156156
{
157157
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ICalculatorService))
158158
{
159-
return new System.ServiceModel.EndpointAddress("http://localhost:5000/CalculatorService/basicService/CalculatorService/basicHttp");
159+
return new System.ServiceModel.EndpointAddress("http://localhost:5000/CalculatorService/basicHttp");
160160
}
161161
if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ICalculatorService))
162162
{

Basic/Services/Hosting/WindowsService/Service/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
// Add the Calculator Service
3939
builder.AddService<CalculatorService>(serviceOptions =>
4040
{
41+
serviceOptions.BaseAddresses.Clear();
4142
// Set the default host name:port in generated WSDL and the base path for the address
42-
serviceOptions.BaseAddresses.Add(new Uri($"http://localhost:{HttpPort}/CalculatorService/basicService"));
43+
serviceOptions.BaseAddresses.Add(new Uri("http://localhost/CalculatorService"));
44+
serviceOptions.BaseAddresses.Add(new Uri($"net.tcp://localhost:{NetTcpPort}/CalculatorService"));
4345
})
4446
// Add BasicHttpBinding endpoint
45-
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new BasicHttpBinding(), "/CalculatorService/basicHttp")
46-
// Add NetTcp endpoint
47-
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new NetTcpBinding(), $"net.tcp://localhost:{NetTcpPort}/CalculatorService/netTcp");
47+
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new BasicHttpBinding(), "basicHttp")
48+
// Add NetTcpBinding endpoint
49+
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new NetTcpBinding(), "netTcp");
4850

4951
// Configure WSDL to be available
5052
var serviceMetadataBehavior = app.Services.GetRequiredService<ServiceMetadataBehavior>();

Basic/Services/Hosting/WindowsService/Service/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"commandName": "Project",
55
"dotnetRunMessages": true,
66
"launchBrowser": true,
7-
"launchUrl": "http://localhost:5000/CalculatorService/basicService",
7+
"launchUrl": "http://localhost:5000/CalculatorService",
88
"environmentVariables": {
99
"ASPNETCORE_ENVIRONMENT": "Development"
1010
}

0 commit comments

Comments
 (0)