×

Discussion Board

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

    Question Http on 6630 -- Nokia Please HELP ME!!!!

    Hello,
    I am using 6630 firmware: V 4.03.38 25-04-05 RM-1
    I am posting to website and I know there there should be a response back from the server but when I do
    Code:
    InputStream in = con.openInputStream ();
    int c = 0;
    c = in.read();
    c is always -1. Is this a known bug? and con.getLength() is -1. I ran it on 6630 phone with fw: 3.45 and it works fine. also works on 6600!!!!

    Additional Info:
    My midlet is 250Kb. I downloaded picomidp browser and it actually worked and it is only 65kb. could it be that the midlet is too large?


    -------------Here is my code excerpt---------
    Code:
        private static byte[] exec(byte[] bProc, Vector vParams) throws Exception
        {
    	ByteArrayOutputStream os = new ByteArrayOutputStream();
    	write(os, bXmlHdr);
    	write(os, bMethodCall);
    	write(os, bMethodName);
    	write(os, bProc);
    	write(os, bEndMethodName);
    	write(os, bParams);
    	writeParams(os, vParams);
    	write(os, bEndParams);
    	write(os, bEndMethodCall);
    	os.flush();
    	byte[] request = os.toByteArray();
    	HttpConnection con = (HttpConnection) Connector.open(sHttpServer, Connector.READ_WRITE);
    	con.setRequestMethod(HttpConnection.POST);
    	con.setRequestProperty("Content-Length", Integer.toString(request.length));
    	con.setRequestProperty("Content-Type", "text/xml");
    	con.openOutputStream().write(request);
    	// Open an input stream on the server's response
    // NOTE: con.getLength() == -1 :(
    	InputStream in = con.openInputStream ();
    // NOTe: in.read() is -1 and I know there is data because I traced the server output 
    	Exception error = null;
    	String result = null;
    	try
    	{
    	    result = parseResult(in);
    	}
    	catch(Exception e)
    	{
    	    error = e;
    	}
    	finally
    	{
    	    try 
    	    {
    		con.close();
    		in.close();
    	    }
    	    catch(Exception e1){}
    	}
    	if (error != null)
    	    throw error;
    	return result != null ? result.getBytes() : "".getBytes();
        }
    Last edited by earamsey; 2005-11-30 at 00:41.

Similar Threads

  1. Interjection Problem on Nokia 6630
    By bajwa_78 in forum Symbian Media (Closed)
    Replies: 15
    Last Post: 2006-07-24, 09:02
  2. Sending message between Nokia 6260 and Nokia 6630 problem
    By fgozman in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-03-18, 11:10
  3. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46
  4. Replies: 2
    Last Post: 2003-02-19, 03:10

Posting Permissions

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