Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc code first base address #305

Open
khalilBerakdar opened this issue Aug 16, 2023 · 0 comments
Open

grpc code first base address #305

khalilBerakdar opened this issue Aug 16, 2023 · 0 comments

Comments

@khalilBerakdar
Copy link

Description:
I'm experiencing an issue with the gRPC client library where it seems to be ignoring the endpoint path in the URL configuration. Here's a clear example of the problem:

Scenario:

I've configured the gRPC client using the AddCodeFirstGrpcClient method with the address set to "https://test-api.com/ms/er/"
csharp
Copy code

services.AddCodeFirstGrpcClient<ITestClient>((serviceProvider, o) =>
{
    o.Address = new Uri("https://test-api.com/ms/er/");
}).ConfigureChannel(...).AddCallCredentials(...);

Within my interface definition, ITestClient, I have annotated the service contract with [ServiceContract(Name = "TestService")].

When I call a method on the client instance like this:

await testClient.GetUserExample(new RequestMessage() { Value = value });

The call is unexpectedly redirected to https://test-api.com/TestService/GetUserExample instead of respecting the full URL with the endpoint path (/ms/er/).

Expected Behavior:
I expect the gRPC client to use the full URL I've provided (https://test-api.com/ms/er/) for the endpoint call. It should not omit the endpoint path (/ms/er/) from the URL.

Request:

I'd appreciate any insights or workarounds on how to properly configure the gRPC client to respect the full URL, including the endpoint path. If this is a limitation of the library, guidance on how to achieve the desired behavior or suggestions for alternative approaches would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant