Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.Form not working from WML

Status
Not open for further replies.

awj100

Programmer
Joined
Sep 24, 2004
Messages
3
Location
GB
I'm trying to POST information from a WML page to a page called Engine.asp which extracts the information (Request.Form("....")) and sets the property of an ActiveX EXE with it.
For example, the following POST string is produced from the page:

StreamType=playback&DateFrom=051105&DateTo=051105&TimeFrom=1400&TimeTo=1401&Camera=0.Constant

Which is as expected.
If I then use

Response.Write "StreamType: " & Request.Form("StreamType")

on the page Engine.asp, the POSTed information shows up just fine whereas if I use the line

RequestQ.StreamType(Request.Form("StreamType"))

to set the property in the ActiveX it produces a blank. The ActiveX simply allows my web page to send into a particular message queue, and if I examine the message at the other end it shows up as

Message=""

I would suspect that the ActiveX is in error except that if I do exactly the same from an HTML page rather than a WML page the message is received as

Message=playback

which corresponds with StreamType in the POSTed information.

So why is it that when I POST the information from a WML page it can be extracted using Request.Form and placed on a subsequent page, but doesn't place any information in the ActiveX's property, yet when I POST the information from an HTML page the ActiveX's property is set with the relevant POSTed information?
The same results are obtained whether I use POST or GET.

This has been driving me mad for four days now.
 
If this works:
[green]Response.Write "StreamType: " & Request.Form("StreamType")[/green]

And this doesn't work:
[red]RequestQ.StreamType(Request.Form("StreamType"))[/red]


Then it doesn't look like the Request.Form("StreamType") is the problem.

As a simple test, try:
RequestQ.StreamType("HardCodedValue")


 
Thanks for those pointers Sheco, but still nothing.
Here's the code for the whole page:

<%
Dim RequestQ
Set RequestQ = Server.CreateObject("MQweb.Postbox")

RequestQ.MQLabel "Test"
RequestQ.StreamType("playback")
'Hardcoded test value
RequestQ.DateFrom Request.Form("DateFrom")
RequestQ.DateTo Request.Form("DateTo")
RequestQ.TimeFrom Request.Form("TimeFrom")
RequestQ.TimeTo Request.Form("TimeTo")
RequestQ.Camera Request.Form("Camera")
RequestQ.PostMessage

Response.ContentType = "text/vnd.wap.wml"
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Cache-Control", "no-cache,must-revalidate"
Response.CacheControl = "private"

If (InStr(Request.ServerVariables("HTTP_ACCEPT"), "wml")) Then

Response.Write "<?xml version='1.0' encoding='ISO-8859-1'?>"
Response.Write "<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' '
Response.Write "<wml>"

Response.Write "<card id='playbackDandT' title='" & Session("Username") & "' newcontext='true'>"
Response.Write "<p align='center'>"
Response.Write "StreamType: " & Request.Form("StreamType")
Response.Write "<br />"
Response.Write "DateFrom: " & Request.Form("DateFrom")
Response.Write "<br />"
Response.Write "DateTo: " & Request.Form("DateTo")
Response.Write "<br />"
Response.Write "TimeFrom: " & Request.Form("TimeFrom")
Response.Write "<br />"
Response.Write "TimeTo: " & Request.Form("TimeTo")
Response.Write "<br />"
Response.Write "Camera: " & Request.Form("Camera")
Response.Write "</p>"
Response.Write "</card>"

Response.Write "</wml>"

Else
'if from an HTML page
Response.Redirect("Entry.asp")
End If
%>


What makes this problem very peculiar is, as I said before, that if I POST information to it from an HTML page everything works fine and the message comes out the other end correctly formatted. However, POSTing to it from a WML page seems to bypass all the RequestQ stuff at the top of the script and go straight to the page generation stuff in the bottom half.
This is true even when I hard-code a value as you suggested (as you'll see above) which still produced a blank message at the other end.

Is there anything in the order that an ASP page is generated that would mean that the form is somehow blanked by the time it gets to the RequestQ lines?
 
Blindshot: where is <postfield> spec?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
The post fields come from this page:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "
<wml>
<card id="playbackDandT" title="<%Response.Write Session("Username")%>">

<p align="center">
Request Playback:
</p>
<p>
From Date: <input name="DateFrom" format="NNNNNN" maxlength="6" />
<br />
To Date: <input name="DateTo" format="NNNNNN" maxlength="6" />
<br />
From Time: <input name="TimeFrom" format="NNNN" maxlength="4" size="4" />
<br />
To Time: <input name="TimeTo" format="NNNN" maxlength="4" size="4" />
<br />
Camera: <select name="Camera">
<%While Not TSO.AtEndOfStream
lineText = TSO.ReadLine
Response.Write "<option value=""" & lineText & """>"
Response.Write lineText
Response.Write "</option>"
Wend%>
</select>
</p>
<p align="center">
<anchor title="Enter">
Enter
<go href="Engine.asp" method="post">
<postfield name="StreamType" value="playback" />
<postfield name="DateFrom" value="$(DateFrom)" />
<postfield name="DateTo" value="$(DateTo)" />
<postfield name="TimeFrom" value="$(TimeFrom)" />
<postfield name="TimeTo" value="$(TimeTo)" />
<postfield name="Camera" value="$(Camera)" />
</go>
</anchor>
</p>

</card>
</wml>

That's obviously the WML version. The HTML vesion (which I won't copy in here unless you specifically want to see it) produces exactly the same POST string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top