473,287 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Post Data (Urgent)

Hello,

I am posting some credit card info to the payment
server via a similar code. My code is written in VB.NET
but uses the same approach. At the end however I do a
response.write(streamReader.ReadToEnd());

----------------------------------
string stringPost = Request.Form.ToString(); // remember a
post is essentially a string delimited in a special way
....

// Here typically you should accept the form elements
(e.g., Request.Form.Get("txn_id")) and store them in local
variables.
....
HttpWebRequest httpWebRequest = (HttpWebRequest)
WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");
httpWebRequest.Method = "POST";
httpWebRequest.ContentLength = stringPost.Length + 21; //
length plus 21 because &cmd=_notify-validate is 21 chars
long
httpWebRequest.ContentType = "application/x-www-form-
urlencoded";
StreamWriter streamWriter = null;
streamWriter = new StreamWriter
(httpWebRequest.GetRequestStream());
stringPost = stringPost + "&cmd=_notify-validate";
streamWriter.Write(stringPost);
streamWriter.Close();
HttpWebResponse httpWebResponse = (HttpWebResponse)
httpWebRequest.GetResponse();
using (StreamReader streamReader = new StreamReader
(httpWebResponse.GetResponseStream()))
{
stringResult = streamReader.ReadToEnd();
streamReader.Close();
}
----------------------------------

Now my question is the following. I store some information
in the session which I need after the above has executed.
Unfortunaly the session variables do not exist. But when I
close this window and go to my basket then I can see all
information which are stored in the session. So the
session variables are not lost, but they are not
accessible in the result of the httpWebResponse. Is there
a way get my session variables work there too?

Please help me out with any suggestions. This is really
URGENT for me.

Thanks
Nov 19 '05 #1
2 1526
I don't see you calling any session variables in this code...

A session variable usually looks like this:
Session("SiteBgcolor") = "Blue"

Or, if you are trying call one it's just:
Color = Session("SiteBGcolor")

Nov 19 '05 #2

"Vishal" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
Hello,

I am posting some credit card info to the payment
server via a similar code. My code is written in VB.NET
but uses the same approach. At the end however I do a
response.write(streamReader.ReadToEnd());

----------------------------------
string stringPost = Request.Form.ToString(); // remember a
post is essentially a string delimited in a special way
...

// Here typically you should accept the form elements
(e.g., Request.Form.Get("txn_id")) and store them in local
variables.
...
HttpWebRequest httpWebRequest = (HttpWebRequest)
WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");
httpWebRequest.Method = "POST";
httpWebRequest.ContentLength = stringPost.Length + 21; //
length plus 21 because &cmd=_notify-validate is 21 chars
long
httpWebRequest.ContentType = "application/x-www-form-
urlencoded";
StreamWriter streamWriter = null;
streamWriter = new StreamWriter
(httpWebRequest.GetRequestStream());
stringPost = stringPost + "&cmd=_notify-validate";
streamWriter.Write(stringPost);
streamWriter.Close();
HttpWebResponse httpWebResponse = (HttpWebResponse)
httpWebRequest.GetResponse();
using (StreamReader streamReader = new StreamReader
(httpWebResponse.GetResponseStream()))
{
stringResult = streamReader.ReadToEnd();
streamReader.Close();
}
----------------------------------

Now my question is the following. I store some information
in the session which I need after the above has executed.
Unfortunaly the session variables do not exist. But when I
close this window and go to my basket then I can see all
information which are stored in the session. So the
session variables are not lost, but they are not
accessible in the result of the httpWebResponse. Is there
a way get my session variables work there too?

Please help me out with any suggestions. This is really
URGENT for me.

Thanks


This code looks like the backend code for paypal's ipn conversation. Paypal
posts a transaction to the page and your code sends a response back with
what they posted to you and adds some validate text and then they send a
command response back. Not sure were the session id would come into play.
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Badri Narayanan | last post by:
I accept a few user inputs and a file from the user, post it to my ASP page. I'm able to receive the data as well as the file properly in Receiver.asp. In my receiver.asp, I need to process the...
1
by: Vishal | last post by:
Hello, I need to send some data via the post method from my web aspx page to an asp page. Does anybody know how I can do that? Please advise me. Thanks
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
1
by: David Thielen | last post by:
Hi; I would like to display a page then immediately cause a post back (the 1st page will have a big "working..." on it, then in the post back do my query which will take a couple of seconds, and...
8
by: Laith Zraikat | last post by:
I am trying to invoke a post request from code behind of an asp.net page using "WebClient" object, and I want the user to be redirected to the action url as well. So far Ive been able to send...
10
by: rup | last post by:
Hello, This is my first application on socket programming in vc++. I am facing problem that how to make connection to server, & make GET/POST request by HTTP. Please help me. Its urgent.......
12
by: =?Utf-8?B?Sm9uYXMgRXJpY3Nzb24=?= | last post by:
The release notes for IIS 6.0 talks about ASP support for POSTs from clients that are using chunked Transfer-encoding. Does anyone know what this support means? It does not seem to be possible to...
6
by: =?Utf-8?B?VGVycnk=?= | last post by:
When I asked this question before, don't think I was showing up as an MSDN subscriber, so I hope that is fixed now. I am a newbe here and am working through some books on using ADO.Net. These...
2
by: =?Utf-8?B?TGlzYUNvbnN1bHQ=?= | last post by:
I have 2 web services and they are on different servers. I am supposed to POST a serialized XML document from one site to the other. I've looked around, but I'm totally confused. Can anyone...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.