【发布时间】:2022-12-02 04:12:38
【问题描述】:
Client proxy returns a message
The API description of the App.AdministrationService.Sequences.ISequencesAppService.GetListAsync method was not found!
However, when I looked up the json file AdministrationService-generate-proxy.json, I found an item.
"GetListAsyncByInput": { "uniqueName": "GetListAsyncByInput", "name": "GetListAsync", "httpMethod": "GET", "url": "api/administration-service/sequences", "supportedVersions": [], "parametersOnMethod": [ { ....Then the Repository looks this:
public interface ISequencesAppService : IApplicationService { Task<PagedResultDto<SequenceDto>> GetListAsync(GetSequencesInput input); Task<SequenceDto> GetAsync(Guid id); Task DeleteAsync(Guid id); Task<SequenceDto> CreateAsync(SequenceCreateDto input); Task<SequenceDto> UpdateAsync(Guid id, SequenceUpdateDto input); }and the controller :
[RemoteService(Name = AdministrationServiceRemoteServiceConsts.RemoteServiceName)] [Area("administrationService")] [ControllerName("Sequence")] [Route("api/administration-service/sequences")] public class SequenceController : AbpController, ISequencesAppService { private readonly ISequencesAppService _sequencesAppService; public SequenceController(ISequencesAppService sequencesAppService) { _sequencesAppService = sequencesAppService; } [HttpGet] public virtual Task<PagedResultDto<SequenceDto>> GetListAsync(GetSequencesInput input) { return _sequencesAppService.GetListAsync(input); } ...I'm not sure what caused this error, but one thing I did was produce a CRUD from the abp suite, and everything was generated. Then I constructed a Static Client Proxy, and all of this is on the AdministrationService module.
I'm using a wpf client, thus I created a client proxy with csharp parameters.
The client module looks like:
[DependsOn( typeof(AdministrationServiceApplicationContractsModule), typeof(AbpPermissionManagementHttpApiClientModule), typeof(AbpFeatureManagementHttpApiClientModule), typeof(AbpSettingManagementHttpApiClientModule), typeof(AbpAuditLoggingHttpApiClientModule), typeof(LanguageManagementHttpApiClientModule), typeof(TextTemplateManagementHttpApiClientModule), typeof(AbpHttpClientModule) )] public class AdministrationServiceHttpApiClientModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddHttpClientProxies( typeof(AdministrationServiceApplicationContractsModule).Assembly, AdministrationServiceRemoteServiceConsts.RemoteServiceName ); context.Services.AddStaticHttpClientProxies( typeof(AdministrationServiceApplicationContractsModule).Assembly, AdministrationServiceRemoteServiceConsts.RemoteServiceName ); } }I did clean and rebuild the project many times and it still complaining.
【问题讨论】:
-
Without knowing abp but the url in your json does not fit the Route to the shown controller. The route ends in
/sequencesbut your json points at/global-reference-configurations. -
@Ralf - ohh nah sorry my mistake, I copied the wrong context. I'd updated the incorrect one.
标签: c# asp.net asp.net-core abp