Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:38:59+00:00 2026-06-01T07:38:59+00:00

I am using a payment gateway API in my ASP.Net application. When testing in

  • 0

I am using a payment gateway API in my ASP.Net application. When testing in MonoDevelop with XSP the application works. When I configure it to run in apache2 with mod_mono the code keeps crashing with a timeout error.

I am stumped as to what could change with hosting in Apache instead of XSP. Anyways below is the code that is timing out:

private string SubmitXml(string InputXml)
{
    HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(_WebServiceUrl);
    webReq.Method = "POST";

    byte[] reqBytes;

    reqBytes = System.Text.Encoding.UTF8.GetBytes(InputXml);
    webReq.ContentType = "application/x-www-form-urlencoded";
    webReq.ContentLength = reqBytes.Length;
    webReq.Timeout = 5000;
    Stream requestStream = webReq.GetRequestStream();
    requestStream.Write(reqBytes, 0, reqBytes.Length);
    requestStream.Close();

    HttpWebResponse webResponse = (HttpWebResponse)webReq.GetResponse();
    using (StreamReader sr = new StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.ASCII))
    {
        return sr.ReadToEnd();
    }
}

The code is crashing on the line: Stream requestStream = webReq.GetRequestStream();

The error returned is:

The request timed out

Description: HTTP 500. Error processing request.

Stack Trace:

System.Net.WebException: The request timed out at
System.Net.HttpWebRequest.GetRequestStream () [0x0005f] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System/System.Net/HttpWebRequest.cs:746
at TCShared.PxPay.SubmitXml (System.String InputXml) [0x00048] in
/Users/liam/Projects/techcertain/techcertaincsharp/Components/TCShared/PaymentGateways/Client/PxPay.cs:85
at TCShared.PxPay.GenerateRequest (TCShared.RequestInput input)
[0x00015] in
/Users/liam/Projects/techcertain/techcertaincsharp/Components/TCShared/PaymentGateways/Client/PxPay.cs:69

In my Web.Config I have the following as the request timeout:

<httpRuntime executionTimeout="43200" maxRequestLength="104856" requestValidationMode="2.0"  />

I have tried changing the Timeout value on the HttpWebRequest but it still is timing out.

What is causing this to happen and how can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:39:00+00:00Added an answer on June 1, 2026 at 7:39 am

    I managed to find out why I was experiencing this problem. It is completely unrelated to the use of Apache.

    I am using Npgsql for database access to Postgresql. Npgsql comes with two dlls (Npgsql.dll and Mono.Security.dll). For some unknown reason Mono.Security.dll causes the HttpWebRequest to timeout when running on Mono.

    Anyways Mono.Security.dll isn’t needed when running on Mono because it is already included in the Mono framework. So after removing the Mono.Security dll from my bin directory HttpWebRequest’s are now working.

    Full credit goes to this post here http://mono.1490590.n4.nabble.com/The-request-timed-out-at-HttpWebRequest-EndGetResponse-td2218213.html .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the authorize.net as my payment gateway which accept payment from credit
I am trying to use Authorize.net's SIM payment gateway process and am using the
i am using Magento 1.5.1.0 and the mPAY24 Payment Gateway Extension. I have an
I'm looking to do Authorize.net payment integration with a website using PHP. My questions
I have an website on asp.net-mvc, I'm thinking of using paypal for payments, is
I'm considering using eWay as payment gateway. They offer two options. One is to
I having trouble posting XML to a payment gateway using PHP. The gateway (PSiGate)
I am using paypal standard as my payment gateway. My problem is that, in
I am processing credit cards using a payment gateway. To POST the data to
i m using paypal Standard as a payment gateway, i need to use recurring

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.