简体   繁体   English

502在azure'网站'内请求付款服务

[英]502 requesting payment service inside azure 'website'

I am getting this error from a call to an external payment service. 我通过拨打外部支付服务收到此错误。 The error only occurs when deployed to azure and works perfectly locally. 该错误仅在部署到azure时发生,并且在本地完美运行。

"Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server." “Web服务器在充当网关或代理服务器时收到无效响应。您正在查找的页面存在问题,无法显示。当Web服务器(充当网关或代理)与上游联系时内容服务器,它收到内容服务器的无效响应。“

The payment service class are generated with this wdsl 使用此wdsl生成支付服务类

https://pal-test.adyen.com/pal/Payment.wsdl https://pal-test.adyen.com/pal/Payment.wsdl

It appears that the error occurs in the authorise method of the Payment class but I cant get azure to log anything useful even when all logging options are on. 似乎错误发生在Payment类的authorize方法中,但即使所有日志记录选项都打开,我也无法记录任何有用的东西。

Has anyone else had this problem? 有没有其他人有这个问题?

UPDATE UPDATE

I have narrowed the problem down a little. 我把问题缩小了一点。 The test method of the controller below will cause an azure website to crash with a 502 and restart. 下面的控制器的测试方法将导致azure网站与502崩溃并重新启动。

public class TestController : Controller
{      
    public string test()
    {
        try
        {
            var webClient = new WebClient();
            var stream = webClient.OpenRead("https://pal-test.adyen.com/pal/servlet/soap/Payment");
            var streamReader = new StreamReader(stream);
            return streamReader.ReadToEnd();

        }
        catch (Exception exp)
        {
            errorResult(exp);
        }
        return formattedResult(result);
    }    
}

MS seem to have removed some of the HTTP protocol for azure website. MS似乎已经删除了azure网站的一些HTTP协议。 Specifically this is blocked it seems SEC_I_RENEGOTIATE. 特别是这被阻止似乎是SEC_I_RENEGOTIATE。

Is there any work around? 有什么工作吗? Does anyone know if this method will work in a web role? 有谁知道这种方法是否适用于Web角色?

It's possibly a problem with the proxy server in use... try the following 使用代理服务器可能存在问题...请尝试以下操作

UseDefaultWebProxy=false

to stop your app using machine specific proxy settings and instead use any user defined / web.config settings. 使用计算机专用代理设置停止您的应用程序,而是使用任何用户定义的/ web.config设置。

As JcFX commented above, the URL you are using is incorrect!... it should be 正如JcFX上面评论的那样,你使用的URL是不正确的!......它应该是

https://pal-test.adyen.com/pal/servlet/soap/Payment

ie you are missing the hyphen in pal-test 即你在pal-test中缺少连字符

当我转到该URL时,它似乎想要使用HTTP身份验证,您是否获得了可以设置的测试系统的密码?

webClient.Credentials = new NetworkCredential("username", "password");

Do you by any chance use a .pfx certificate file or similar? 您是否有机会使用.pfx证书文件或类似文件?

If so, the way you reference it could be problematic in Azure, consider using Azure CertificateStore instead of having your certificates on the filesystem(if you're doing this now) 如果是这样,您在Azure中引用它的方式可能会有问题,请考虑使用Azure CertificateStore而不是在文件系统上拥有您的证书(如果您现在正在执行此操作)

for more details: https://msdn.microsoft.com/en-us/library/azure/gg465712.aspx 有关详细信息: https//msdn.microsoft.com/en-us/library/azure/gg465712.aspx

also relevant: 也相关:

https://azure.microsoft.com/blog/2014/10/27/using-certificates-in-azure-websites-applications/ https://azure.microsoft.com/blog/2014/10/27/using-certificates-in-azure-websites-applications/

Hope this helps! 希望这可以帮助! Good luck to you, this problem has been a real nightmare for me! 祝你好运,这个问题对我来说是一场真正的噩梦!

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

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