Skip to content

Commit

Permalink
update service enpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
afifi-ins committed Feb 2, 2023
1 parent 5e46882 commit d2ee854
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ExtendedData": {
"inputs": [
"http://localhost:5000/CalculatorService/basicService"
"http://localhost:5000/CalculatorService"
],
"collectionTypes": [
"System.Array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointCo
{
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ICalculatorService))
{
return new System.ServiceModel.EndpointAddress("http://localhost:5000/CalculatorService/basicService/CalculatorService/basicHttp");
return new System.ServiceModel.EndpointAddress("http://localhost:5000/CalculatorService/basicHttp");
}
if ((endpointConfiguration == EndpointConfiguration.NetTcpBinding_ICalculatorService))
{
Expand Down
10 changes: 6 additions & 4 deletions Basic/Services/Hosting/WindowsService/Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
// Add the Calculator Service
builder.AddService<CalculatorService>(serviceOptions =>
{
serviceOptions.BaseAddresses.Clear();
// Set the default host name:port in generated WSDL and the base path for the address
serviceOptions.BaseAddresses.Add(new Uri($"http://localhost:{HttpPort}/CalculatorService/basicService"));
serviceOptions.BaseAddresses.Add(new Uri("http://localhost/CalculatorService"));
serviceOptions.BaseAddresses.Add(new Uri($"net.tcp://localhost:{NetTcpPort}/CalculatorService"));
})
// Add BasicHttpBinding endpoint
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new BasicHttpBinding(), "/CalculatorService/basicHttp")
// Add NetTcp endpoint
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new NetTcpBinding(), $"net.tcp://localhost:{NetTcpPort}/CalculatorService/netTcp");
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new BasicHttpBinding(), "basicHttp")
// Add NetTcpBinding endpoint
.AddServiceEndpoint<CalculatorService, ICalculatorService>(new NetTcpBinding(), "netTcp");

// Configure WSDL to be available
var serviceMetadataBehavior = app.Services.GetRequiredService<ServiceMetadataBehavior>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "http://localhost:5000/CalculatorService/basicService",
"launchUrl": "http://localhost:5000/CalculatorService",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down

0 comments on commit d2ee854

Please sign in to comment.