Open Closed

Could not found remote action for method #5724


User avatar
0
niall created
  • ABP Framework version: v7.3.2
  • UI Type: MVC
  • Database System: EF Core ( MySQ)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:

[09:12:19 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "对不起,在处理你的请求期间,产生了一个服务器内部错误!", "details": null, "data": {}, "validationErrors": null }

[09:12:19 ERR] Could not found remote action for method: System.Threading.Tasks.Task1[XTC.BaaSo.VendorService.Vendors.VendorDTO] CreateAsync(XTC.BaaSo.VendorService.Vendors.VendorCreateDTO) on the URL: https://localhost:44380 Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task1[XTC.BaaSo.VendorService.Vendors.VendorDTO] CreateAsync(XTC.BaaSo.VendorService.Vendors.VendorCreateDTO) on the URL: https://localhost:44380 at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.GetActionApiDescriptionModel(IAbpMethodInvocation invocation) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at XTC.BaaSo.VendorService.Web.Pages.Vendors.CreateModalModel.OnPostAsync() in E:\github\BaaSo\BaaSo-Cloud\vs2022\services\vendor\src\XTC.BaaSo.VendorService.Web\Pages\Vendors\CreateModal.cshtml.cs:line 28 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()

  • Steps to reproduce the issue:
  1. I created a microservice-pro
  2. Follow the ProductService sample to implement my new service VendorService.
  3. generated the clientproxy and migration database.
  4. Run the AuthServer, IdentityService, AdministrationServicce, SaasService, ProducService, VendorService(https://localhost:44361), WebGateway(https://localhost:44380), Web(https://localhost:44381)
  5. GetList, Create, Update, Delete of the ProductService works fine at Web(https://localhost:44381)
  6. GetList of the VendorService works fine and return items at Web(https://localhost:44381), but Create throw the CreateAsync Exception

I found create the product, log like this:

[09:10:04 INF] Executing handler method XTC.BaaSo.ProductService.Web.Pages.Products.CreateModalModel.OnPostAsync - ModelState is Valid
[09:10:04 INF] Start processing HTTP request POST https://localhost:44380/api/product-service/products?api-version=1.0

but create the vendor, log like this:

[09:12:19 INF] Executing handler method XTC.BaaSo.VendorService.Web.Pages.Vendors.CreateModalModel.OnPostAsync - ModelState is Valid
[09:12:19 ERR] ---------- RemoteServiceErrorInfo ----------
{
  "code": null,
  "message": "对不起,在处理你的请求期间,产生了一个服务器内部错误!",
  "details": null,
  "data": {},
  "validationErrors": null
}

[09:12:19 ERR] Could not found remote action for method: System.Threading.Tasks.Task`1[XTC.BaaSo.VendorService.Vendors.VendorDTO] CreateAsync(XTC.BaaSo.VendorService.Vendors.VendorCreateDTO) on the URL: https://localhost:44380

so i called the /api/vendor-service/vendors use swagger of WebGateway, select the VendorService definition, and i got right response. request:

curl -X 'POST' \
  'https://localhost:44361/api/vendor-service/vendors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0skLF9slS5ET4rntZpU1Mu6psP1jcKmHZSNalTmrkXD6bJtD5JwXef-JHxXCl4ygS0V1B_n-Fl4t8IfPB5VbStDfVxds-VzzxUDn2oSl3MID3SZOCQJ8otCUoGBeLKcN9x4zNT2VeGHxesFf2_T3iYytrfOkWiRwM8yT5UihrNq14wij5OOvf59gT7kXB_EkEkxzw' \
  -H 'Content-Type: application/json' \
  -H 'RequestVerificationToken: CfDJ8Fdcgn1lYTlCsW6eEpOaA4s_uqelPSN0IxCtuE8ANzKwx7JkcMAyqWbhFlthOb8YSSDcTUfC80W-_XAEhHWTtXgFYZxGzs4vFrHYeK4cYXOyYCpaxz1TmhLYysNJej40NnrtND8RbzLSEtV4fEqjGNnWnojawoE3ku7o6ry_NxewHMOXbScIYORK3Z6H90zZfA' \
  -H 'X-Requested-With: XMLHttpRequest' \
  -d '{
  "name": "test",
  "display": "test1"
}'

response:

{
  "name": "test",
  "display": "test1",
  "isDeleted": false,
  "deleterId": null,
  "deletionTime": null,
  "lastModificationTime": null,
  "lastModifierId": null,
  "creationTime": "2023-09-06T11:46:50.1886199+08:00",
  "creatorId": "3a0d7a9b-ec37-923a-fb70-d7300bd7bfac",
  "id": "3a0d7ac6-6cb2-ed66-2de7-f138c7897eed",
  "extraProperties": {}
}

and i called the /api/vendor-service/vendors use curl, i got right response too.

request:

curl --location 'https://localhost:44380/api/vendor-service/vendors' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjBGREU3QzJGNDhDQjlGMEIzMUQ1NDVBRkVEOTdEQzU2RkJFODhBNEYiLCJ4NXQiOiJEOTU4TDBqTG53c3gxVVd2N1pmY1Z2dm9pazgiLCJ0eXAiOiJhdCtqd3QifQ.eyJzdWIiOiIzYTBkN2E5Yi1lYzM3LTkyM2EtZmI3MC1kNzMwMGJkN2JmYWMiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbiIsImVtYWlsIjoiYWRtaW5AYWJwLmlvIiwicm9sZSI6ImFkbWluIiwiZ2l2ZW5fbmFtZSI6ImFkbWluIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjoiRmFsc2UiLCJlbWFpbF92ZXJpZmllZCI6IkZhbHNlIiwidW5pcXVlX25hbWUiOiJhZG1pbiIsIm9pX3Byc3QiOiJXZWJHYXRld2F5X1N3YWdnZXIiLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo0NDMwMC8iLCJvaV9hdV9pZCI6IjNhMGQ3YWM2LTJhYTctYjYzNC1mOWQ1LTVkYWJjYmFiZGU1OSIsImNsaWVudF9pZCI6IldlYkdhdGV3YXlfU3dhZ2dlciIsIm9pX3Rrbl9pZCI6IjNhMGQ3YWM2LTJiODQtYTAxNy1jZWZhLTM5M2M3YmI4NWY4MiIsImF1ZCI6IkJ1c2luZXNzVW5pdCIsInNjb3BlIjoiQnVzaW5lc3NVbml0IiwianRpIjoiYzIxYzZiYjAtMDdmMS00YmYzLWI0NzAtZTFjYzE4ZTcyYzBjIiwiZXhwIjoxNjkzOTc1NTkzLCJpYXQiOjE2OTM5NzE5OTN9.PS6Xhh6nNCTaSPUgcbxFoiStaUYCaAd2ZhjqgmaNdjLOSyxJMK3O147OmyibuQD9wepRzDeF2jgrFE0GaOrCiZfek6ceAJvA0OiF6rdgEBoqR-XXsPqnBFxX8EWqmb8zCXYbSks9ISvin3XEV0skLF9slS5ET4rntZpU1Mu6psP1jcKmHZSNalTmrkXD6bJtD5JwXef-JHxXCl4ygS0V1B_n-Fl4t8IfPB5VbStDfVxds-VzzxUDn2oSl3MID3SZOCQJ8otCUoGBeLKcN9x4zNT2VeGHxesFf2_T3iYytrfOkWiRwM8yT5UihrNq14wij5OOvf59gT7kXB_EkEkxzw' \
--data '{
  "name": "3",
  "display": "33333"
}'

response:

{
    "name": "3",
    "display": "33333",
    "isDeleted": false,
    "deleterId": null,
    "deletionTime": null,
    "lastModificationTime": null,
    "lastModifierId": null,
    "creationTime": "2023-09-06T11:56:52.4975455+08:00",
    "creatorId": "3a0d7a9b-ec37-923a-fb70-d7300bd7bfac",
    "id": "3a0d7acf-9d7e-0127-1efa-a46a51918906",
    "extraProperties": {}
}

so how can i resolve this error? thanks.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    DynamicHttpProxyInterceptor1

    It seems you are using DynamicHttpProxy now. Is this what you expected?

    https://docs.abp.io/en/abp/latest/API/Static-CSharp-API-Clients https://docs.abp.io/en/abp/latest/API/Dynamic-CSharp-API-Clients

  • User Avatar
    0
    niall created

    Hi maliming,

    Thanks for reply, Around your prompt, I resolved this issue.

    1. I use abp generate-proxy -t csharp -u https://localhost:44361/ -m vendorService, and delete files that differ from the ProductService sample and manual modify the VendorService-generate-proxy.json. resolve: add --without-contracts and don't make any modifications.
    2. ProductServiceHttpApiClientModule use the context.Services.AddStaticHttpClientProxies,but the new project, use the context.Services.AddHttpClientProxies resolve: manual modify context.Services.AddHttpClientProxies to context.Services.AddStaticHttpClientProxies in my new service
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35