[Xerte] Re: Bouncing an asp page
Paul Swanson
Paul.Swanson at harlandfs.com
Tue Jun 14 17:18:18 BST 2011
I'm not an asp coder, but that looks like it should work. Is undefined
what your asp script is reporting, or Xerte?
One thing I've found that helps debugging stuff like this, is to try to
capture anything received by your asp script, plus any error messages,
and use the script to email it to yourself.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Tuesday, June 14, 2011 9:06 AM
To: Xerte list
Subject: [Xerte] Re: Bouncing an asp page
Tried a few variants but no joy
Response.Write(Request.Form)
Response.Write(Request.Form("addressee"))
undefined.
________________________________
Date: Tue, 14 Jun 2011 08:54:29 -0700
From: Paul.Swanson at harlandfs.com
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] Re: Bouncing an asp page
At the asp end, treat it like it was POST data. sendAndLoadVars defaults
to POST, you can add an optional third argument of "GET" if you want to
use that method.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Tuesday, June 14, 2011 8:35 AM
To: Xerte list
Subject: [Xerte] Re: Bouncing an asp page
Paul, I can assure you it is failing. ;-)
I have a send email just prior to the response.write (I am returning
values).
But I see you are using a literal LoadVars object.
So I have misinterpreted:
Usage
iconID.sendAndLoadVars(url, loadVarsObject);
I was using
objData = new Object();
objData.dummy = 'testlv';
send_email.sendAndLoadVars('http://www.blah.com/cj/mail.asp', objData);
objData = new LoadVars(); //of course solves it.
Duh.
Thanks for opening my bleary eyes.
So at the asp end is that object access by Query or Form?
________________________________
Date: Tue, 14 Jun 2011 08:08:17 -0700
From: Paul.Swanson at harlandfs.com
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] Re: Bouncing an asp page
It's probably not failing, just not returning anything so Xerte doesn't
have anything to do. If your asp script echoes back any values, they'll
be captured as an object:
// send data to php script
URLString = domain + '/wbt/app/admin/selfpaced_xerte_queries.php';
sendVars = new LoadVars ();
sendVars.action = 'getData';
sendVars.sid = student.id;
// send to db
mainMenu.sendAndLoadVars (URLString, sendVars); // mainMenu is the page
ID
===================
Then use an event interaction with onSendAndLoadVars as the event. The
returned values are assigned to an object named loadVars (I think
ActionScript defaults to that name, I don't know if you can change it).
My script returns variables (using either echo or print) such as
'message' and 'error_code' and I access them like so:
message = mainMenu.loadVars.message;
errorCode = mainMenu.loadVars.error_code;
Pretty simple once you get the hang of it.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: Tuesday, June 14, 2011 7:40 AM
To: Xerte list
Subject: [Xerte] Re: Bouncing an asp page
xmlData = new XML();
xmlData.dummy = '<myDummy/>';
send_email.sendAndLoad(xmlData, 'http://www.blah.com/cj/mail.asp');
//works
objData = new Object();
objData.dummy = 'fred';
send_email.sendAndLoadVars('http://www.blah.com/cj/mail.asp', objData);
//fails
Is this failing because at present the asp returns nothing?
a la Authorware?
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 14 Jun 2011 14:56:44 +0100
Subject: [Xerte] Re: Bouncing an asp page
One way or another you will have to send text, so will have to get your
data into xml or load vars, or send it as an xml payload, as text in a
format of your choosing.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 14 June 2011 14:55
To: Xerte list
Subject: [Xerte] Re: Bouncing an asp page
But I want to send data, just not in xml.
blah = new object();
blah.one = 'fred';
etc
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 14 Jun 2011 14:51:48 +0100
Subject: [Xerte] Re: Bouncing an asp page
Send a dummy.
<myDummy/>
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 14 June 2011 14:51
To: Xerte list
Subject: [Xerte] Re: Bouncing an asp page
OK, but say I don't want to send XML.
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 14 Jun 2011 14:48:05 +0100
Subject: [Xerte] Re: Bouncing an asp page
Yep. Then see if iconID.onSendAndLoad fires - test to a local html file
or text file or xml file or...
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 14 June 2011 14:47
To: Xerte list
Subject: [Xerte] Bouncing an asp page
OK, just want to make sure I have this right:
sendAndLoad
iconID.sendAndLoad(xml, url);
Posts.
Wants the data in the form of an XML object, i.e. new XML()
Object first parameter.
=====================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110614/9d7a3fa4/attachment-0001.html>
More information about the Xerte
mailing list