Ben,
Im sorry. What I meant was it seems that writing a fault using
Hessian2Output could not be read by Hessian2Input. Instead of throwing the
fault that was written, it throws an IOExceptionWrapper:
java.lang.UnsupportedOperationException . Here's one of my code to test
that. Again, if my way of testing is incorrect, please let me know and
recommend a better way of testing if possible. I got this implementation
from reading the source code of the HessianSkeleton class of the Java
Hessian 3.1.1 release.

START CODE

// Write hessian response with a NullPointerException as fault
1  ByteArrayOutputStream outStream = new ByteArrayOutputStream();
2  Hessian2Output outHessian = new Hessian2Output(outStream);
3  outHessian.startReply();
4  Exception e = new NullPointerException("id");
5  outHessian.writeFault("ServiceException", e.getMessage(), e);
6   outHessian.completeReply();

// Read hessian response from the stream created above
7  ByteArrayInputStream inStream =
8      new ByteArrayInputStream(outStream.toByteArray ());
9  Hessian2Input inHessian = new Hessian2Input(inStream);
10  inHessian.startReply(); // Excpetion is thown at this line
11  inHessian.completeCall();

END CODE

I interchange Hessian2Output and HessianOutput in line 2 and Hessian2Input
and HessianInput in line 11 to compare the results of using different
Hessian specifications. I assume that HessianOutput and HessianInput follows
the Hessian 1 Specifications and Hessian2Output and Hessian2Input follows
the Hessian 2 Specifications. The results are as follow:

  - Using HessianOutput and HessianInput: throws
  java.lang.NullPointerException: id
  - Using HessianOutput and Hessian2Input: throws
  java.lang.NullPointerException: id
  - Using Hessian2Output and HessianInput: throws
  com.caucho.hessian.io.HessianProtocolException: unknown code:
  - Using Hessian2Output and Hessian2Input : throws
  com.caucho.hessian.io.IOExceptionWrapper:
  java.lang.UnsupportedOperationException:
  [EMAIL PROTECTED]

And yes the service uses the Hessian 2 Specification. I used the
HessianServlet class of the Java Hessian 3.1.1 release.


- ian
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to