473,431 Members | 1,608 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,431 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 1533
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.