I get that exception (-20015) when the midlet can't connect to the server, either because it cannot be reached or because it doesn't respond.
Check if the server can be reached (from your PC) and check if the phone really establishes a connection (with another app that connects to somewhere on the internet).
I've also found the same problem connecting to a W2K RAS server using a Nokia 7650 with a GSM access point. The server (Weblogic 6.1) acknowledged the request from a client but performed no action! After finding the below bug report from the Java KVM forum I decided to download a packet sniffer and inspect further. I found the exact scenario below. The first HTTP request packet contained the GET request which looked fine, the second packet contained the header information which was incorrect. The underlying software is incorrectly formatting the HTTP 1.1 header. The header contained "Connection: close" and the following character is LF and with no CR? The problem occurs with every header packet element. The CR is left out on each header element. Due to this problem the Webserver is rejecting the request.
Nokia can you please tell me when a work around is planned to fixed this problem since I hear no reply from you in any forums. To me this is a rather major bug in the firmware release which is causing considerable problems for developers.
Date: Thu, 21 Nov 2002 07:31:10 -0700
Reply-To: A mailing list for KVM discussion <KVM-INTEREST@JAVA.SUN.COM>
Sender: A mailing list for KVM discussion <KVM-INTEREST@JAVA.SUN.COM>
From: Mark E Wallace <mark_e_wallace@HOTMAIL.COM>
Subject: Nokia 7650 HTTP Headers
I'm testing with a Nokia 7650 (firmware 3.16). When I use a HttpConnection object to post data back to a server I've noticed that the HTTP headers are delimited with just the line feed (LF = 0a) character and not the carriage return - line feed combination (CRLF = 0d0a), also the header section is being correctly terminated with CRLFCRLF. This is causing problems for our application as the requests are being treated as bad requests by the server, is there a fix/work around for this problem?
Well, the 7650 connection now works fine using an analogue modem with a W2K RAS server. After finding the error (previous reply) I decided to write a router to fix the Nokia HTTP header packet. The client (7650) simply connects to the router and the router swallows the incorrect Nokia packets and sends out correct header packets to the Web server. The phone now works a treat.
I must admit it would have been nice for someone at Nokia to at least reply to the problem.