3
votes

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.

"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."

The payment service class are generated with this wdsl

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.

Has anyone else had this problem?

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.

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. Specifically this is blocked it seems SEC_I_RENEGOTIATE.

Is there any work around? Does anyone know if this method will work in a web role?

3
Could it be the Azure firewall blocking the api response? Or the payment service blocking your worker from Azure? - ElvisLives
the payment service has no block on ips and azure accepts the async requests that come from the provider so i dont think its a firewall issue. - Jules
I have put some logging on the app start event and it shows that the site restarts on each payment provider request. so the crash must be very harsh. What could cause this.? - Jules
I also found this link which seems to be a very similar problem. Does anyone know if MS have fixed this?social.msdn.microsoft.com/Forums/en-US/… - Jules
Is it relevant that the link you're trying to load cannot be found in a browser? paltest.adyen.com/pal/servlet/soap/Payment - "Firefox can't find the server at paltest.adyen.com." - Jude Fisher

3 Answers

0
votes

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.

As JcFX commented above, the URL you are using is incorrect!... it should be

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

i.e. you are missing the hyphen in pal-test

0
votes

When I go to that url it seems to want to use HTTP authentication, did you get a password for the test system you could set?

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

Do you by any chance use a .pfx certificate file or similar?

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)

for more details: 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/

Hope this helps! Good luck to you, this problem has been a real nightmare for me!