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

Dynamic HttpApi Client throw exception Missing path parameter value for xx parameter #5897

Closed
seayxu opened this issue Oct 22, 2020 · 5 comments
Assignees
Milestone

Comments

@seayxu
Copy link

seayxu commented Oct 22, 2020

Abp : 3.2.1 -m none --no-ui --separate-identity-server --tiered

step 1: Created project with paramter -m none --no-ui --separate-identity-server --tiered

step 2: Migrated database.

setp 3: Added PackageReference Volo.Abp.Identity.HttpApi.Client to HttpApi.Host

setp 4: Added AbpIdentityHttpApiClientModule to HttpApiHostModule DependOn.

setp 5: Added remote service url to appsettings.json

"RemoteServices": {
    "Default": {
      "BaseUrl": "https://localhost:44383/"
    }
  }

setp 6: Added a Controller and method like this:

public class HomeController : AbpController
{
    IIdentityUserAppService IdentityUserAppService;
    public HomeController(IIdentityUserAppService identityUserAppService)
    {
        IdentityUserAppService = identityUserAppService;
    }

    [HttpGet]
    [Route("user")]
    public async Task<IdentityUserDto> IdentityUser(string name)
    {
        return await IdentityUserAppService.FindByUsernameAsync(username: name);
    }
}

setp 7: Run all host project,then test home/user interface,throw exception:

Volo.Abp.AbpException: Missing path parameter value for userName (userName)
   at Volo.Abp.Http.Client.DynamicProxying.UrlBuilder.ReplacePathVariables(StringBuilder urlBuilder, IList`1 actionParameters, IReadOnlyDictionary`2 methodArguments, ApiVersionInfo apiVersion)
   at Volo.Abp.Http.Client.DynamicProxying.UrlBuilder.GenerateUrlWithParameters(ActionApiDescriptionModel action, IReadOnlyDictionary`2 methodArguments, ApiVersionInfo apiVersion)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.MakeRequestAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.MakeRequestAndGetResultAsync[T](IAbpMethodInvocation invocation)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.GetResultAsync(Task task, Type resultType)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
@seayxu
Copy link
Author

seayxu commented Oct 22, 2020

But I new a module for test is ok by project reference.

@maliming maliming self-assigned this Oct 22, 2020
@maliming maliming added this to the 3.3-final milestone Oct 22, 2020
@maliming
Copy link
Member

@seayxu Please share a project.

@seayxu
Copy link
Author

seayxu commented Oct 22, 2020

@maliming https://github.com/seayxu/Abp.Demo

@kuiyouli
Copy link

Has this problem been solved? I have the same problem!

@maliming
Copy link
Member

This available in abp v3.3 version and above。

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

3 participants