• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ASP page not receiving HTTP request data

 
Monica Young
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this in your connection code.


Let me know if this works
 
Monica Young
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ASP code was posted above. The input stream will read whatever is written to the page.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic