You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2007/06/24 06:44:18 UTC

Re: [Axis2] Accessing SOAP message from MessageContexts in Handlers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This seems to be a bug for me. Can you please create a JIRA giving
enough information to re-create this problem. Also please mark the issue
as a blocker as I think this should be fixed before the next release.

Thanks,
Chinthaka

Kevin TierOne wrote:
> Hi Wayne,
> 
> We've talked about this but I thought I'd post to see if anyone else can
> give us insight.
> 
> 
> The original message context of the
> MySoapReceiverInOut.invokeBusinessLogic() code stores the incoming soap
> envelope.  If your skeleton throws an exception, AxisFault.handleFault()
> will replace the messageContext's soap envelope with
> faultContext.getEnvelope().  If there is no exception in your code, the
> setEnvelope() call is not invoked.
> 
> 
> The reason why you cannot use
> msgContext.getOperationContext().getMessageContext("In") to get the
> orignal envelope, is that the getMessage("In") refers to the original
> message context (because the hashmap stores a reference to original
> message context).  Its envelope was overwritten with the fault envelope
> during the fault handling.  Not sure why there is also a
> getMessage("Fault") that returns the same envelope.  Perhaps it's a bug
> or maybe there is a reason for this.  I don't know enough about the
> Axis2 code.
> 
> 
> Kevin
> 
> 
> ------------------------------------------------------------------------
> From: weeznat@hotmail.com <ma...@hotmail.com>
> To: axis-user@ws.apache.org <ma...@ws.apache.org>
> Subject: Accessing SOAP message from MessageContexts in Handlers
> Date: Wed, 20 Jun 2007 16:09:20 -0400
> 
> 
>     Using Axis2 1.2.  Is there a way to read the original SOAP message
>     within a PostDispatch Handler? 
> 
>     I'm invoking a custom handler in the PostDispatch phase.  The
>     handler reads the uses the MessageContext to get the original soap
>     request message.  Something like this:
> 
>       String
>     incomingMsg=msgContext.getOperationContext().getMessageContext("In").getEnvelope().toString();
>       System.out.println("Original SOAPMessage: "+incomingMsg);
> 
>     This works fine in the success case.  The problem is if the Skeleton
>     code throws an exception, the above code prints the "Fault" soap
>     message.  For example, the following code prints exactly the same
>     output:
> 
>       String
>     incomingMsg=3DmsgContext.getOperationContext().getMessageContext("In").getEnvelope().toString();
>       System.out.println("SOAPMessage: "+incomingMsg);=0A=
> 
>       String
>     faultMsg=3DmsgContext.getOperationContext().getMessageContext("Fault").getEnvelope().toString();
>       System.out.println("SOAPMessage: "+faultMsg);
> 
>     Am I doing something incorrectly?  Is there another way to get the
>     original SOAP message in a Handler?
> 
>     Thanks,
>     Wayne
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGffahjON2uBzUhh8RAmhoAJ9w2uBSnBQCvihrHLBbMwpscTbE8ACggMhn
tf3Xh5X4Uc1VnRCaN2KP79s=
=bfc1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org