dotnet-sdk/examples/Client/ServiceInvocation
Fabian Steinbach e3efbad010
Add example for invoking non-Dapr HTTP endpoints using DaprClient (#1519)
Signed-off-by: fabistb <fabian0401@online.de>
Co-authored-by: Whit Waldo <whit.waldo@innovian.net>
2025-07-03 10:48:24 -05:00
..
Example.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
InvokeServiceGrpcExample.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
InvokeServiceHttpClientExample.cs Remove unused using statements. (#1313) 2024-10-24 17:00:09 -05:00
InvokeServiceHttpExample.cs replaced license headers (#802) 2021-12-10 13:39:06 -08:00
InvokeServiceHttpNonDaprEndpointExample.cs Add example for invoking non-Dapr HTTP endpoints using DaprClient (#1519) 2025-07-03 10:48:24 -05:00
Program.cs Add example for invoking non-Dapr HTTP endpoints using DaprClient (#1519) 2025-07-03 10:48:24 -05:00
README.md Add example for invoking non-Dapr HTTP endpoints using DaprClient (#1519) 2025-07-03 10:48:24 -05:00
ServiceInvocation.csproj Fixed security advisory updates across dependencies (transitive and direct) (#1366) 2024-10-15 18:09:53 -05:00

README.md

Dapr .NET SDK service invocation example

Prerequisites

Running the example

To run the sample locally run this command in the DaprClient directory:

dapr run --app-id DaprClient -- dotnet run <sample number>

Running the following command will output a list of the samples included:

dapr run --app-id DaprClient -- dotnet run

Press Ctrl+C to exit, and then run the command again and provide a sample number to run the samples.

For example run this command to run the 0th sample from the list produced earlier.

dapr run --app-id DaprClient -- dotnet run 0

HTTP client

Make sure to first run the Routing Service to have a service to invoke.

See InvokeServiceHttpClientExample.cs for an example of using HttpClient to invoke another service through Dapr.

Dapr HTTP client

Make sure to first run the Routing Service to have a service to invoke.

See InvokeServiceHttpExample.cs for an example using the DaprClient to invoke another service through Dapr.

Dapr gRPC client

Make sure to first run the GrpcService to have a service to invoke.

See InvokeServiceGrpcExample.cs for an example using the DaprClient to invoke a service using gRPC through Dapr.

Dapr Non-Dapr endpoint

Make sure to first run the Routing Service to have a service to invoke.

See InvokeServiceHttpNonDaprEndpointExample for an example using the DaprClient to invoke a non-Dapr endpoint through Dapr.