Hello,
 
I am having problems using Hessian micro edition on the client.
 
I use a HessianServlet on the server and can call the remote methods on
it from a client using HessionProxyFactory (J2SE). However I need to do
the same from J2ME. I am using J9 for my tests. I have setup a simple
test method called hello which returns a String. I use the following
code in the Hessian client.
 
      try
      {
        System.out.println(url);
        conn = (HttpConnection)Connector.open(url);
        conn.setRequestMethod(HttpConnection.POST);
        os = conn.openOutputStream();
        MicroHessianOutput out = new MicroHessianOutput(os);
        out.startCall("hello");
        out.completeCall();
        os.flush();
      
        is = conn.openInputStream();
        MicroHessianInput in = new MicroHessianInput(is);
        in.startReply();
        String value = in.readString();
        in.completeReply();
        System.out.println(value);
      }
      finally
      {
        if (os != null)
        {
          os.close();
        }
        if (is != null)
        {
          is.close();
        }
      }
 
However I get the following error (any ideas)?
 
Exception in thread "main" java.net.SocketException: The connection was
reset
        at java.net.SocketImpl.receiveStreamImpl(Native Method)
        at java.net.SocketImpl.read(SocketImpl.java:397)
        at java.net.SocketInputStream.read(SocketInputStream.java:137)
        at
com.ibm.oti.connection.socket.Connection$1.read(Connection.java:268)
        at java.io.InputStream.read(InputStream.java:93)
        at
java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:113)
        at
java.io.BufferedInputStream.read(BufferedInputStream.java:185)
        at
com.ibm.oti.connection.http.Connection.readln(Connection.java:1114)
        at
com.ibm.oti.connection.http.Connection.readServerResponse(Connection.
java:1096)
        at
com.ibm.oti.connection.http.Connection.doRequest(Connection.java:920)
 
        at
com.ibm.oti.connection.http.Connection.openInputStream(Connection.jav
a:1202)
        at TestClass.main(TestClass.java:35)
 
 
 
 
 
Best Regards
Paul
 
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to