DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16417>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16417

No deserialization context after changing SOAPBody in handler

           Summary: No deserialization context after changing SOAPBody in
                    handler
           Product: Axis
           Version: current (nightly)
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hi

As requested by dims on the axis-dev mailinglist I hereby post a test for the
bug I posted on the list.

I am not sure where the correct place for the test is, but as I looked at the
jaxrpchandler test in the wsdl directory for inspiration, I have placed it there :).

For reference I have copied part of my original posting on the axis-dev list below.

Please let me know if there is anything I can do to help fix the bug.

Cheers
Claus Nyhus Christensen
[EMAIL PROTECTED]

Original message:

I am trying to create a simple handler which alters the content of the
SOPABody of an incoming SOAP message.

The web service I am using is a simple "echo" web service with a single
method called echo. The methods takes a string and just returns it.

Now, when my client tries to call the web service, I get an exception.

I have been looking into the code, and it seems that the way the
original SOAPBody is build is different from the way it is done when you
use the JAXM methods on the SOAPBody class.

I have tried the same example using the JAXRPC/SAAJ reference
implementations and it works just fine there.

To me it seems that:

1. I am doing something completely wrong in my handler
or
2. The addBodyElement on the SOAPBody class is not working as is should

If you agree with me that number 2 is the case, I would like to help
create a fix. But I cannot figure out how I am going to be able to get a
DeserializationContext in the SOAPBody class.

A related problem occur if you use the addChildElement on SOAPBody
instead of addBodyElement. When you do this a new MessageElement is
added to the SOAPBody. However, this will result in a ClassCastException
in the processMessage of the RPCProvider class. Line 141 and 142 gives
the problem:
if (!(bodies.get(bNum) instanceof RPCElement)) {
SOAPBodyElement bodyEl = (SOAPBodyElement)bodies.get(bNum);

Since the MessageElement is not an instance of RPCElement, it is cast to
a SOAPBodyElement. This will result in the ClassCastException. This case
also works fine on the JAXRPC/SAAJ reference implementation.

The fix seems to be to overwrite the addChildElement methods in SOAPBody
(which it inherits from MessageElement) to make sure that
SOAPBodyElements (or maybe RPCElement) are always added. However, this
fix will have the same problem with the DeserializationContext as stated
above.

Reply via email to