This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes ASP page not receiving HTTP request data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "ASP page not receiving HTTP request data" Watch "ASP page not receiving HTTP request data" New topic
Author

ASP page not receiving HTTP request data

Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
First - I'm new to J2ME & I'm a novice to java in general. I'm an ASP programmer & I need to write an app for a nextel phone in J2ME.

I have written a test application that just sends an http request to my asp page and the page should send back the appropriate response to be displayed on the phone, however the asp page does not seem to be receiving the data. However it IS sending back a response. I have tried removing flush() from the dataOutputStream, but that didn't fix the problem. Here is the code inside my MIDlet:


[ May 10, 2006: Message edited by: Mark Spritzler ]
Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
the ASP code:
<%
PIN = request("PIN")
If PIN = "" Then
response.write "INVALID"
Else
response.write "GOOD"
End If
%>

This code always returns "INVALID" no matter what I pass it.

Any help would be greatly appreciated.
[ May 10, 2006: Message edited by: Monica Young ]
Punit Raizada
Ranch Hand

Joined: Mar 20, 2004
Posts: 156
Try this in your connection code.


Let me know if this works


SCJP 1.4
Everything that can go wrong will go wrong -Murphy
Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
The asp page is still not seeing the POST data. I have since gotten the code to work using a StreamConnection object. I had to replace all the spaces with '%20', but that was no big deal. Here's the code I used for the connection, in case anyone's interested.


[ May 11, 2006: Message edited by: Monica Young ]
Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
This seem to be an ASP / VBScript issue.

I would really rather use POST so if anyone has any suggestions, I would really appreciate the help

Thanks in advance.
Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
Someone answered my question in another forum. They told me not to send the content length, put an \r at the end of my POST data & not to loop through the postmsg to write to the Output Stream. Moral: Don't always trust code from an online tutorial.

Here's my working POST to ASP code:

[ May 12, 2006: Message edited by: Monica Young ]
Battula lakshman
Greenhorn

Joined: Apr 24, 2006
Posts: 9
hi can you please post the ASP code please i am also facing the same problem in the SERVER side.
I am new to ASP
please help me
lakshman
Monica Young
Greenhorn

Joined: May 10, 2006
Posts: 9
The ASP code was posted above. The input stream will read whatever is written to the page.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ASP page not receiving HTTP request data
 
Similar Threads
HTTP connection thread problem to SERVLET on APACHE
servlet -> midlet null problem
MIDlet cann't connect to servlet on website
Problem while building session with doPost method (at server side)
Help: Potential deadlock in commandAction() ?