Hello Hessian Users (resent since too large)
I have no idea why this occurs but this is what I had to do to fix my
problem.
For the J2ME client....
conn = (HttpConnection)Connector.open(url);
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestProperty("content-type","x-application/hessian");
// HAD TO ADD
//os = new BufferedOutputStream(conn.openOutputStream()); //
COULD NOT USE
os = conn.openOutputStream();
MicroHessianOutput out = new MicroHessianOutput(os);
out.startCall("helloByteArray");
out.completeCall();
//os.flush(); // HAD TO COMMENT OUT
is = new BufferedInputStream(conn.openInputStream());
MicroHessianInput in = new MicroHessianInput(is);
in.startReply();
String hello = in.readString();
in.completeReply();
For some reason if I did not set the content-type to
"x-application/hessian" it just did not work - both on IBM J9 and (SUN
J2SE + JSR197)
I tried to use a BufferedOutputStream but this failed on IBM J9, however
it worked on (SUN J2SE + JSR197)
The one that annoyed me the most was the os.flush() - In theory a call
to os.flush() when using a raw OpenInputStream should do nothing yet
this caused a problem on IBM J9
Using (SUN J2SE + JSR197) the out.flush() was fine and could be used
with or without the BufferedOutputStream
Just for your information I am using an implementation of JSR197 that
uses the standard J2SE io libraries to implement.
I would love to know why I have to do the above. If anyone can let me
know I would appreciate it.
Cheers
Paul
Ps. see previous email for full story
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest