Open Closed

Tenant-Edition Subscription Could not get HttpClientProxyConfig #4867


User avatar
0
clinton.redden created
  • ABP Framework version: v7.1.1

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace: [07:49:49 ERR] An unhandled exception has occurred while executing the request. Volo.Abp.AbpException: Could not get HttpClientProxyConfig for Volo.Saas.Subscription.ISubscriptionAppService. at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Saas.Host.ClientProxies.SubscriptionClientProxy.CreateSubscriptionAsync(Guid editionId, Guid tenantId) at portal._2cr.io.Web.Public.Pages.Signup.SignupModel.OnPostAsync() in /Users/clinton.redden/Documents/Projects/OmniEther/portal._2cr.io/src/portal._2cr.io.Web/Pages/Signup/Signup.cshtml.cs:line 26 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() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.

  • Steps to reproduce the issue: I followed the steps for setting up payment methods using the payments module at https://docs.abp.io/en/commercial/latest/modules/payment followed by the steps for setting up a payment subscription at https://docs.abp.io/en/commercial/latest/modules/payment#subscriptions and then the steps for creating tenant edition subscriptions at https://docs.abp.io/en/commercial/latest/modules/saas#tenant-edition-subscription. When I POST the form I get this response anytime I use the following code snippit in my webapp.

public class IndexModel : PageModel
{
        protected ISubscriptionAppService SubscriptionAppService { get; }

        protected ICurrentTenant CurrentTenant { get; }

        public IndexModel(
            ISubscriptionAppService subscriptionAppService,
            ICurrentTenant currentTenant)
        {
            SubscriptionAppService = subscriptionAppService;
            CurrentTenant = currentTenant;
        }

        public async Task<IActionResult> OnPostAsync(Guid editionId)
        {
            var paymentRequest = await SubscriptionAppService.CreateSubscriptionAsync(editionId, CurrentTenant.GetId());

            return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);
        }
    }

Please give me guidance on resolving the above issue.


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

    Hi,

    It's a problem, we will fix it and your ticket refunded.

    You can add the following code to the WebModule class:

    Configure<AbpHttpClientOptions>(options =>
    {
        options.HttpClientProxies.Add(typeof(ISubscriptionAppService),new HttpClientProxyConfig(typeof(ISubscriptionAppService),SaasHostRemoteServiceConsts.RemoteServiceName));
    });
    
  • User Avatar
    0
    clinton.redden created

    Thank you. I have verified this additional piece of code made it work.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11