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
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!!!!Code:InputStream in = con.openInputStream (); int c = 0; c = in.read();
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(); }




Reply With Quote

