3

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?

Jules
  • 1,071
  • 2
  • 18
  • 37
  • Could it be the Azure firewall blocking the api response? Or the payment service blocking your worker from Azure? – ElvisLives Aug 21 '12 at 16:59
  • 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 Aug 23 '12 at 12:34
  • 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 Aug 23 '12 at 12:41
  • I also found this link which seems to be a very similar problem. Does anyone know if MS have fixed this?http://social.msdn.microsoft.com/Forums/en-US/windowsazurewebsitespreview/thread/636c6f0b-1229-429a-9566-66272b462ab8 – Jules Aug 23 '12 at 12:53
  • Is it relevant that the link you're trying to load cannot be found in a browser? https://paltest.adyen.com/pal/servlet/soap/Payment - "Firefox can't find the server at paltest.adyen.com." – Jude Fisher Aug 24 '12 at 11:45

3 Answers3

0

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

Paul Zahra
  • 9,522
  • 8
  • 54
  • 76
  • the hyphen was a typo the problem still applies. I have corrected the code sample. regarding the proxy would this mean I have to set up another webserver outside azure to proxy the payment requests? – Jules Aug 28 '12 at 07:54
  • 1
    why would it work in a web role but not in a 'website' . shouldnt MS want to fix this? – Jules Aug 29 '12 at 15:34
0

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");
Jason Goemaat
  • 28,692
  • 15
  • 86
  • 113
0

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!

Anders Martini
  • 828
  • 1
  • 14
  • 31