Re: Issue with Nokia HttpConnection.flush()

Chris B <[email protected]> Tue, 23 Jun 2009 03:21:44 +0100
Newsgroups gmane.comp.java.sun.kvm,gmane.spam.detected
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C9F3B1.BBD96F80
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

content-length: -1 (although I explicitly set it to the byte array =
length)
connection: close (implicitly set)
content-type: application/x-www-form-urlencoded (explicitly set)
transfer-encoding: chunked (implicitly set)


you cant have a chunked with a content length! it's one or the other.

  ----- Original Message -----=20
  From: Ricardo Scholz=20
  To: [email protected]=20
  Sent: Monday, June 22, 2009 9:25 PM
  Subject: Issue with Nokia HttpConnection.flush()


  Hello everybody,

  I've been trying to implement a client-server application that =
exchanges byte arrays through a HTTP connection. My client-server =
application works fine with a Motorola V3, but when I try to connect =
from a Nokia 5310 XpressMusic, the input stream in the server cannot be =
read (it comes empty). I used a software that receives the connection =
and forwards the request to the server, to see some information about =
what was being sent by the clients, so I got the information below:

  In the successful Motorola version, the header parameters are:

  content-length: -1 (although I explicitly set it to the byte array =
length)
  connection: close (implicitly set)
  content-type: application/x-www-form-urlencoded (explicitly set)
  transfer-encoding: chunked (implicitly set)

  and the actual data sent has the chunked formatting (the chunk size =
prepended and a zeroed chunk size to inform the end of the chunks =
sequence), as below:

  29
  =
3333223=1Dcdefghijkb=96=9F5=A9=A6=9C=936=93=94=95=96<=93=94=95=96=97=98r=99=
=9A=9B
  0

  In the other hand, the unsuccessful Nokia version has the following =
header parameters:

  content-length: <the actual data length> (explicitly set)
  connection: keep alive (implicitly set)
  content-type: application/x-www-form-urlencoded (explicitly set)
  <no transfer-encoding parameter set>

  and the actual data sent does not have the chunked formating, as =
below:

  =
3333223=1Dcdefghijkb=96=9F5=A9=A6=9C=936=93=94=95=96<=93=94=95=96=97=98r=99=
=9A=9B

  I used pretty much the networking implementation as defined in the =
API. In addition, as far as I could understand, the call to =
HttpConnection.flush() sets the transfer-encoding header parameter to =
chunked, but it only works for the Motorola version. Without it, none of =
the two versions works fine, as it seems that the server can only deal =
with chunked data.

  I've tried to find something in the Forum Nokia, KVM-Interests =
archives and Google, but without actual success.

  If you guys have any idea on how to work this around, either in the =
client application or in the server application, I'd appreciate.

  Many thanks.

  Best regards,

  Ricardo Scholz.

  --=20
  ricardo]scholz
  meantime]mobile.creations
  +55[81]8664.8665
  =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 To unsubscribe, send email to [email protected] and include in the =
body of the message "signoff KVM-INTEREST". For general help, send email =
to [email protected] and include in the body of the message "help". 

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
------=_NextPart_000_0005_01C9F3B1.BBD96F80
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>content-length: -1 (although I explicitly set it to the byte array=20
length)<BR>connection: close (implicitly set)<BR>content-type:=20
application/x-www-form-urlencoded (explicitly set)<BR>transfer-encoding: =
chunked=20
(implicitly set)</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>you cant have a chunked with a content =
length! it's=20
one or the other.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A [email protected] =
href=3D"mailto:[email protected]">Ricardo=20
  Scholz</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
[email protected]=20
  =
href=3D"mailto:[email protected]">[email protected]</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, June 22, 2009 =
9:25 PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Issue with Nokia=20
  HttpConnection.flush()</DIV>
  <DIV><BR></DIV>Hello everybody,<BR><BR>I've been trying to implement a =

  client-server application that exchanges byte arrays through a HTTP=20
  connection. My client-server application works fine with a Motorola =
V3, but=20
  when I try to connect from a Nokia 5310 XpressMusic, the input stream =
in the=20
  server cannot be read (it comes empty). I used a software that =
receives the=20
  connection and forwards the request to the server, to see some =
information=20
  about what was being sent by the clients, so I got the information=20
  below:<BR><BR>In the successful Motorola version, the header =
parameters=20
  are:<BR><BR>content-length: -1 (although I explicitly set it to the =
byte array=20
  length)<BR>connection: close (implicitly set)<BR>content-type:=20
  application/x-www-form-urlencoded (explicitly =
set)<BR>transfer-encoding:=20
  chunked (implicitly set)<BR><BR>and the actual data sent has the =
chunked=20
  formatting (the chunk size prepended and a zeroed chunk size to inform =
the end=20
  of the chunks sequence), as=20
  =
below:<BR><BR>29<BR>3333223=1Dcdefghijkb=96=9F5=A9=A6=9C=936=93=94=95=96&=
lt;=93=94=95=96=97=98r=99=9A=9B<BR>0<BR><BR>In=20
  the other hand, the unsuccessful Nokia version has the following =
header=20
  parameters:<BR><BR>content-length: &lt;the actual data length&gt; =
(explicitly=20
  set)<BR>connection: keep alive (implicitly set)<BR>content-type:=20
  application/x-www-form-urlencoded (explicitly set)<BR>&lt;no =
transfer-encoding=20
  parameter set&gt;<BR><BR>and the actual data sent does not have the =
chunked=20
  formating, as=20
  =
below:<BR><BR>3333223=1Dcdefghijkb=96=9F5=A9=A6=9C=936=93=94=95=96&lt;=93=
=94=95=96=97=98r=99=9A=9B<BR><BR>I used=20
  pretty much the networking implementation as defined in the API. In =
addition,=20
  as far as I could understand, the call to HttpConnection.flush() sets =
the=20
  transfer-encoding header parameter to chunked, but it only works for =
the=20
  Motorola version. Without it, none of the two versions works fine, as =
it seems=20
  that the server can only deal with chunked data.<BR><BR>I've tried to =
find=20
  something in the Forum Nokia, KVM-Interests archives and Google, but =
without=20
  actual success.<BR><BR>If you guys have any idea on how to work this =
around,=20
  either in the client application or in the server application, I'd=20
  appreciate.<BR><BR>Many thanks.<BR><BR>Best regards,<BR><BR>Ricardo=20
  Scholz.<BR><BR>--=20
  =
<BR>ricardo]scholz<BR>meantime]mobile.creations<BR>+55[81]8664.8665<BR>=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =

  To unsubscribe, send email to [email protected] and include in the =
body of=20
  the message "signoff KVM-INTEREST". For general help, send email to=20
  [email protected] and include in the body of the message "help".=20
</BLOCKQUOTE></BODY></HTML>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".

------=_NextPart_000_0005_01C9F3B1.BBD96F80--