Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HttpWebResponse response = (HttpWebResponse)request.GetResponse();


Come to This Line. The Page Was Load Very Long Time. could not Get A Result.

Please Help Me Anybody .......

Source Code:

string now = DateTime.Now.ToString("dd/MM/yyyy hh:ss:mm").Replace("-", "/");



string ATOMPaymentIP = "paynetzuat.atomtech.in"; // PROVIDED BY ATOM //203.114.240.183--Stage
string ATOMLogin = "160"; // PROVIDED BY ATOM
string ATOMPassword = "Test@123"; // PROVIDED BY ATOM
string ATOMTransactionType = "NBFundTransfer"; // PROVIDED BY ATOM
string ATOMProductId = "NSE"; // PROVIDED BY ATOM


XmlDocument objXML = new XmlDocument();



HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://" + ATOMPaymentIP + "/paynetz/epi/fts");


((HttpWebRequest)request).KeepAlive = false;



request.Method = "POST";


request.ContentType = "application/x-www-form-urlencoded";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; CK={CVxk71YSfgiE6+6P6ftT7lWzblrdvMbRqavYf/6OcMIH8wfE6iK7TNkcwFAsxeChX7qRAlQhvPWso3KI6Jthvnvls9scl+OnAEhsgv+tuvs=}; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
int pos = Request.Url.AbsoluteUri.LastIndexOf('/');

// PAYMENT RESPONSE PAGE
string strURL = Request.Url.AbsoluteUri.Substring(0, pos + 1) + "Payment_Responce.aspx";


string postData = "custacc=1234567890&login=" + ATOMLogin + "&pass=" + ATOMPassword + "&ttype=" + ATOMTransactionType + "&prodid=" + ATOMProductId + "&amt=" + 100 + "&txncurr=INR&txnscamt=0&clientcode=" + "007" + "&txnid=" + 1 + "&date=" + now + "&ru=" + strURL + "&udf1=" + "XXX" + "&udf2=" + "xxx@gmail.com" + "&udf3=" + 9999999999 + "&udf4=" + "XXX" + "&udf5=" + 1 + "&udf6=" + 1;



byte[] byteArray = Encoding.UTF8.GetBytes(postData);



request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";

request.ContentLength = byteArray.Length;






request.ProtocolVersion = HttpVersion.Version10;


ServicePointManager.DefaultConnectionLimit = 1000;
ServicePointManager.MaxServicePointIdleTime = 2000;
ServicePointManager.Expect100Continue = false;



request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;


request.Proxy.Credentials = CredentialCache.DefaultCredentials;




HttpWebResponse response = (HttpWebResponse)request.GetResponse();


Stream dataStream = request.GetRequestStream();


dataStream.Write(byteArray, 0, byteArray.Length);

dataStream.Close();






dataStream = response.GetResponseStream();

objXML.Load(dataStream);

string TxnId = objXML.DocumentElement.ChildNodes[0].ChildNodes[0].ChildNodes[2].InnerText;

string Token = objXML.DocumentElement.ChildNodes[0].ChildNodes[0].ChildNodes[3].InnerText;
string txnData = "ttype=NBFundTransfer&txnStage=1&tempTxnId=" + TxnId + "&token=" + Token;


response.Close();
Response.Redirect("http://" + ATOMPaymentIP + "/paynetz/epi/fts?" + txnData);
Posted
Updated 11-Sep-17 2:21am
v2

1 solution

Contact "Atom". Either their servers are running slow or there is something about your request that is causing a problem.
 
Share this answer
 
Comments
MohamedEliyas 24-Jul-15 8:01am    
many time post this question. but anybody could not answer for this question..
[no name] 24-Jul-15 8:19am    
That is mostly because we are not your service providers customer support people. You need to go ask them.
MohamedEliyas 24-Jul-15 8:04am    
i was face this error. am using same code.

my code error:
The server committed a protocol violation. Section=ResponseStatusLine

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900