×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    IL/USA
    Posts
    341

    E61 & E62 HTTP AGAIN! Please read!

    I fixed the other error message it was coming from internet provider. On E62 i am trying to access internet and I am having trouble. here is the code;
    Code:
    try {
    	HttpMgr.con = (HttpConnection) Connector.open(HttpMgr.sUrl, Connector.READ_WRITE);
    	HttpMgr.con.setRequestMethod(HttpConnection.GET);
    	HttpMgr.con.setRequestProperty("User-Agent",HttpMgr.sAgent);
    	HttpMgr.con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    	HttpMgr.con.setRequestProperty("Content-Length", String.valueOf(HttpMgr.sPostData.length()));
    	HttpMgr.con.setRequestProperty("Cache-Control", "no-transform");
    	HttpMgr.con.setRequestProperty("Content-Language", HttpMgr.sLanguage);
    	HttpMgr.con.setRequestProperty("Accept", "application/octet-stream");
    	HttpMgr.con.setRequestProperty("Connection", "close");
    	int rc = HttpMgr.con.getResponseCode();
    	if (rc != HttpConnection.HTTP_OK)
    	{
    	    isErr = true;
    	}
    	else
    	{
    	    HttpMgr.is = HttpMgr.con.openInputStream();
    	    int ch;
    	    HttpMgr.sbResult.setLength(0);
    	    while ((ch = HttpMgr.is.read()) != -1)
    	    {
    		mCPRAbc.self.debug(""+(char)ch);
    		HttpMgr.sbResult.append((char)ch);
    		// prevent a http loop
    		if (HttpMgr.sbResult.toString().toLowerCase().indexOf("</body>") != -1)
    		{
    		    break;
    		}
    	     }
    	}
            }
    	catch(Exception e)
    	{
    	    e.printStackTrace();
    	    mCPRAbc.self.debug(e.getMessage());
    	    isErr = true;
    	}
    It appears that I am getting "Native Error -5120" now has anyone seen this? Do i have to sign midlet in order to do http on e61/e62?
    Last edited by earamsey; 2006-06-02 at 22:54.

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    30

    Arrow Re: E61 & E62 HTTP AGAIN! Please read!

    -5120 is KErrDndNameNotFound, which basically means the host lookup failed. Might I suggest that you simply write a test app and see whether you can connect to the host normally?

Similar Threads

  1. e61 & e62 keyboard and Canvas
    By earamsey in forum Mobile Java General
    Replies: 1
    Last Post: 2006-05-25, 14:12
  2. E62 and/or E61 [Urgent]
    By earamsey in forum Mobile Java General
    Replies: 3
    Last Post: 2006-05-17, 05:00
  3. Nokia 3230 and S.E k300i can not handle http Connection read while n6030 can read
    By jasmitvala in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-03-21, 14:01
  4. socket read hangs until socket is closed
    By camroe in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-21, 09:44
  5. use http protocol to read data error
    By allfast in forum Mobile Java General
    Replies: 1
    Last Post: 2002-08-02, 06:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×