简体   繁体   English

ASP.NET 零 (ABP) 在控制器中调用简单操作

[英]ASP.NET Zero (ABP) call simple action in controller

I JUST want to call simple method from a controller but on calling, I get ERR_CONNECTION_RESET.我只想从控制器调用简单的方法,但在调用时,我得到 ERR_CONNECTION_RESET。 As I now this error is for services but I haven't any service for this controller or method!我现在这个错误是针对服务的,但我没有针对这个控制器或方法的任何服务! I call class like this :我这样称呼班级:

http://localhost:44302/ReturnBank/Verify?trans_id=b53e8b82-a849-4188-951a-bc7f060422cd&order_id=22&amount=5000&np_status=Unsuccess

Sample Code for Class is :类的示例代码是:

public class ReturnBankController : TimeSheetControllerBase
{
    private readonly SazPayPaymentGatewayConfiguration _SazPayConfiguration;
    
    public ReturnBankController(
        SazPayPaymentGatewayConfiguration SazPayConfiguration)
    {
        _SazPayConfiguration = SazPayConfiguration;
    }

    public async Task<ActionResult> Verify(string trans_id, int order_id, int amount, string np_status)
    {
        if(np_status == "Unsuccess")
        {
            return View("../SazPay/PaymentCancel");
        }
        var SuccessUrl = _webUrlService.GetSiteRootAddress().EnsureEndsWith('/') + "Payment/paymentcompleted";
        var ErrorUrl = _webUrlService.GetSiteRootAddress().EnsureEndsWith('/') + "Payment/PaymentFailed";

        var inp = new SazPayConfirmPaymentInput
        {
            Order_id = order_id,
            Amount = amount,
            Trans_id = trans_id
        };

        var confirmTuple = await _SazPayPaymentAppService.ConfirmPayment(inp);


        if (confirmTuple.Item1)
        {
            Response.Redirect(SuccessUrl);
        }
        else
        {
            Response.Redirect(ErrorUrl);
        }
        return null;
    }

PS: I think abp or aspnetzero magically convert my Controller/Actions to service!!! PS:我认为 abp 或 aspnetzero 神奇地将我的控制器/操作转换为服务!!! I want to stop this for one Controller or Action.我想为一个控制器或操作停止此操作。

For the futures : I found the answer!对于期货:我找到了答案! After one hard day I found that wrong URL was the problem.经过一天的辛苦工作,我发现错误的 URL 是问题所在。 I called HTTP but the right is HTTPS.我调用了 HTTP,但正确的是 HTTPS。

That was problem :(那是问题:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM