As I understand, Series 40 phones do not support socket connections, with the exception of 6800 and 6850 (are there others? does 3200 support sockets?).
The only connection method available is HttpConnection. Suppose that the underlying bearer is CSD. When using HttpConnection, does the URL get parsed, and a TCP connection (HTTP) is opened to the specified server OR does it go through the WAP gateway, using WSP to connect to gateway and passing the URL to the gateway which, in turn, accesses the specified website?
In this latter case (phone->WSP->gateway->HTTP->server), what happens if the response from the server is not WML? Does it get dropped by the server or does it get passed AS IS to the client (phone)?
Specifically, is there a way to access HTML pages through a WAP gateway?
More generally, is there a way to transfer binary data over HTTP through a WAP gateway (WSP-HTTP)?
In case, the answers are (as I suppose):
- HttpConnection connects through the WAP gateway
- you can only access WML, WMLScript, WBMP etc (but not HTML) through a WAP gateway
then how does the Nokia XHTML over WAP 1.2.1 stack browser (such as in the Nokia 3200) work? Does it use some kind of non-public API (native calls)?
Thanks for any info,
M.Sc. (in progress)
University of Toronto
I've been trying to access PHP pages over WAP as well, and it seems I'm stuck at the point where I try to read the output of the HttpConnection.
What I do is I open a HttpConnection to a PHP script disguised as a WML page. The filename and content-type are set accordingly so that it looks like a regular WAP page. I send two parameters, a username and a password, as GET parameters. Finally, I open the connection's DataInputStream and read the data until the end of the stream is reached.
On the WTK emulator all of this works perfectly. On my 7210, however, when I print out the reply of the server, I get only a String "[B@11eaa96" instead of the key-value pairs I'm expecting. The logs on the Apache server show that the request is received correctly.
Bypassing the WAP GW and using a direct mobile Internet GPRS connection is not an option because of the inconvenience of the configuration. (Actually, I haven't even got my direct connection to work at all...)
In case anyone has a suggestion on how to remedy this, I would be really grateful.