Hi Paul.
The ObjectFactory does not exist in J2ME.
I use this implementation, and work fine, sample:
// Call web Service Hessian
String url
="http://192.168.0.101:8080/br.com.exemplo.WebService/test ";
HttpConnection c = (HttpConnection) Connector.open(url);
c.setRequestMethod(HttpConnection.POST);
OutputStream os = c.openOutputStream();
MicroHessianOutput out = new MicroHessianOutput(os);
out.startCall("downloadProdutos");
out.completeCall();
os.flush();
// Begining read return
InputStream is = c.openInputStream();
MicroHessianInput in = new MicroHessianInput(is);
in.startReply();
// Get return JSON from Hessian
String respJSON = in.readString();
// Close Web Service read
in.completeReply();
I read this tutotial (in the end of page):
http://www.caucho.com/resin-3.0/protocols/hessian.xtp
For return a simple String, or int or byte[], all work fine. But if
you try return a List of TO (POJO), you will problem when try
deserialize List of objects in J2ME.
I resolve this problem with JSON. I transform my List of object in a
JSONArray.toString(), and later I can parse ans deserialize this List
in my J2ME.
See the sample in:
http://maillist.caucho.com/pipermail/hessian-interest/2007-October/000148.html
thanks,
Fabio Pinheiro - Brasil
2007/10/10, Paul French <[EMAIL PROTECTED]>:
> Hello all,
>
> The Hessian protocol is exactly what we require to support communication
> between mobile devices running (J2ME personal profile 1.1) and our
> application servers running J2EE
>
> We have a Hessian Servlet running on the J2EE application server with no
> problems. Hessian clients can talk to this with no problem when using
> J2SE
>
> However using J2ME personal profile 1.1 Hessian clients do not work
> since they rely on optional packages not in J2ME personal profile 1.1
>
> The error I get is java.lang.NoClassDefFoundError:
> javax.naming.spi.ObjectFactory
>
> Anyone have any ideas how I can get round this problem since we would
> really like to use Hessian on our remote mobile devices.
>
>
> Best Regards
> Paul
>
>
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest