Hi
Still with the error.
I try with a lot ways.
1 - In server-side, I use the MicroHessianOutPut. I can retuen a String as
byte[], and I can in the client-sidee get this String and deserialyze again.
Perfect.
But when I try deserialize in client an Object (T), I can`t. I receive an
error
2 - In server-side, I try use the HessianOutPut, and I get the same error.
Without sucess.
Is this possible with Hessian? Somebody already obtanied sucess in serialyze
a simple object (TO - that implements Serializable), and deserialyze this
object in J2ME - CDC client with Hessian ??
I do'nt have more idea.. I try a lot of ways.. Without sucess..
It`s possible? Or its a bug in Hessian integratian with (server-side ->
J2ME)..
Is ther other way for this case? I just want serialize a List of object (TO)
ans return this for my client (J2ME).
thanks!
Fábio Pinheiro
2007/10/1, Fábio Pinheiro <[EMAIL PROTECTED]>:
>
> Hi,
> I can't resolve this problem.
>
> In my client application (J2ME - CDC), I can get the return when is a
> String or a int. But, i get the a object (TO sample, as Product). The
> return is a byte[] (array).
>
> How can I serialize again in my object?
>
> Server code:
> public byte[] returnTO() throws Exception {
> ByteArrayOutputStream bos = new ByteArrayOutputStream();
> Hessian2Output out = new Hessian2Output(bos);
>
> out.startMessage();
>
> ProdutoTO prod = new ProdutoTO();
> prod.setCodigo(1);
> prod.setDescricao("prod palhaco");
>
> out.completeMessage();
>
> out.close();
>
> return bos.toByteArray();
> }
>
> Client (J2me - CDC):
> String url =
> "http://localhost:8084/br.com.rosaFlores.WebService/test";
> HttpConnection c = (HttpConnection) Connector.open(url);
>
> c.setRequestMethod(HttpConnection.POST);
>
> OutputStream os = c.openOutputStream();
> MicroHessianOutput out = new MicroHessianOutput(os);
>
> out.startCall("returnTO");
>
> out.completeCall();
>
> os.flush();
>
> InputStream is = c.openInputStream();
> MicroHessianInput in = new MicroHessianInput(is);
>
> in.startReply();
>
>
> //int total = in.readInt();
> //String ok = in.readString();
>
> Object obj = in.readObject(null);
>
> ------------
>
> If I ask the instanceof the obj, is a array byte (byte[]).
> i can't make a cast for my object, teturn error.
>
> How can I cast (or serialize) this object in my TO?
>
> Please, this is the 3º post about this problem.
>
> If anybody can use hessian (return a List of TO [POJO]), please...
>
> thanks,
> Fabio
>
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest