Open Closed

How to Create Static Proxyies for SaasService Microservice . #5353


User avatar
0
ndeol created
  • ABP Framework version: v7.2.2
  • UI type: Angular
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am trying to Call Saas Microservice from Other Abp Microservice and Want to use static Proxy generations. When I use Abp Cli to ceate static proxy It does not genrate Enum type under Dtos.

I get error in build as there is not type. Below ae all the files that are generated. can you Please advice how Can I generate static client proxy for Saas Microservice. I followed yours documented approach. Another issue is if we genrate these proxy under client module then we have to inject Http.Client module to Application module.. Its blocking development, and i will appreciate your response.


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

    hi

    When I use Abp Cli to ceate static proxy It does not genrate Enum type under Dtos.

    What was the command you were using?

    abp generate-proxy ....

  • User Avatar
    0
    ndeol created

    abp generate-proxy -t csharp -u https://localhost:44381/ -m Saas

    And this is my saas Http.Client module code.

    [DependsOn(
        typeof(AbpHttpClientModule),
        typeof(SaasServiceApplicationContractsModule),
        typeof(SaasTenantHttpApiClientModule),
        typeof(SaasHostHttpApiClientModule)
    )]
    public class SaasServiceHttpApiClientModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddHttpClientProxies(
                typeof(SaasServiceApplicationContractsModule).Assembly,
                SaasServiceRemoteServiceConsts.RemoteServiceName
            );
        }
    }
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will try with your command. Wait a moment.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I get error in build as there is not type.

    Add PlanDto to your Dtos folder.

    // This file is automatically generated by ABP framework to use MVC Controllers from CSharp
    using System;
    using Volo.Abp;
    using Volo.Abp.Application.Dtos;
    using Volo.Abp.Domain.Entities;
    
    [Serializable]
    public class PlanDto : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp
    {
        public string Name { get; set; }
    
        public string ConcurrencyStamp { get; set; }
    }
    
    
  • User Avatar
    0
    ndeol created

    I am trying to create Static proxy for TenantAppservice and all SaasHost Module. I dont get error with PlanDto but Enums that are part of TenantDtos.

    I get issue with below ENUM which is part of Saas Domain shared module. Do I create these enums manually and they are not create as part or generation. `public enum TenantActivationState : byte { Active = 0,

    ActiveWithLimitedTime = 1,
    
    Passive = 2
    

    } `

    Like this Dto use the above Enum

    `public class SaasTenantDto : ExtensibleEntityDto

    public Guid? EditionId { get; set; }
    
    public DateTime? EditionEndDateUtc { get; set; }
    
    public string EditionName { get; set; }
    
    public bool HasDefaultConnectionString { get; set; }
    
    public TenantActivationState ActivationState { get; set; }
    
    public DateTime? ActivationEndDate { get; set; }
    
    public string ConcurrencyStamp { get; set; }
    

    }`

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I created the proxy files by ABP CLI 7.3.0-rc.2, Can you try to upgrade your CLI?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07