Open Closed

CLI or Abp Studio cannot generate proxy for new added integration service in a microservice project #9754


User avatar
0
trendline created
  • Exception message and full stack trace: cannot generate the proxies for new added integration services in a microservice project
  • Steps to reproduce the issue: follow the guides Integration Services add interface and implementation for the new integration service, when using abp studio or cli generate the proxy, not proxies generated, the integration service provider microservice is a project template service IdentityService

any miss configuration for integration service, or the generate proxy action is wrong?


2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    To generate proxies for a new integration service in an ABP microservice solution, ensure the following steps are completed:

    1. Define the Integration Service Interface
      • The interface must inherit from IIntegrationService (or IApplicationService for older versions).
      • Place the interface in the Application.Contracts project of the microservice.
    public interface IMyIntegrationService : IIntegrationService
       {
           Task<MyDto> GetDataAsync(Guid id);
       }
    
    1. Implement the Integration Service
      • Implement the interface in the Application project.
    public class MyIntegrationService : MyAppService, IMyIntegrationService
       {
           public Task<MyDto> GetDataAsync(Guid id)
           {
               // Implementation
           }
       }
    
    1. Expose Integration Services in the Provider Microservice
      • In the provider microservice's module (e.g., IdentityServiceHttpApiModule), expose integration services:
    Configure<AbpAspNetCoreMvcOptions>(options =>
       {
           options.ExposeIntegrationServices = true;
       });
    
    1. Build All Projects

      • Ensure all projects are built so the new interface and implementation are available.
    2. Generate Proxies in the Consumer Microservice

      • In the consumer microservice, add a reference to the provider's Application.Contracts project.
      • Run the proxy generation command in the consumer microservice's directory:
    abp generate-proxy -t csharp
    
    • Or use ABP Studio's proxy generation feature.
    1. Check Remote Service Configuration
      • Ensure the remote service is configured in appsettings.json:
    "RemoteServices": {
         "IdentityService": {
           "BaseUrl": "https://localhost:PORT"
         }
       }
    
    1. Register Static Proxies
      • In the consumer's module, register the static HTTP client proxies:
    context.Services.AddStaticHttpClientProxies(
           typeof(YourProviderApplicationContractsModule).Assembly,
           "IdentityService"
       );
    

    Common Issues:

    • If the interface does not inherit from IIntegrationService or is not in the correct project, proxies will not be generated.
    • If the provider microservice is not running or not exposing integration services, the CLI cannot discover the endpoints.
    • Always rebuild the solution after adding new services.

    Reference:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    trendline created

    The generate proxy issue resolved, it caused by a typo which the interface of the integration service not follow the conventional.

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20