axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allegar Robert" <>
Subject RE: can handlers in a chain mutate the message? (newbie)
Date Mon, 09 Sep 2002 17:55:20 GMT
	A handler can do pretty much anything it wants to the entire message. If
you want to change the body, you can. Same goes with the header. You can
even pass an entirely different message along if you want.

	The LogHandler that's distributed as the example just shows how to read the
content of the message. As you said, you could very easily do some XSLT or
other processing in the handler, set the changes on the message and then the
changed message would be passed along to the next handler in the chain (if
one exists). You don't need to explicitly call the next handler in the chain
(as you do in servlet chains) as the axis container will do that for you.

	In general, you should probably try and keep your handlers as discrete and
independent as possible. Look back a few days on this list and you'll see
some code posted that shows you how to modify the headers in the soap
message in the body of a handler.


-----Original Message-----
From: James Carlyle []
Sent: Sunday, September 01, 2002 2:52 PM
Subject: can handlers in a chain mutate the message? (newbie)


Just getting started with Axis.  I read in the example code that the log
handler (java:samples.userguide.example4.LogHandler) implements the 'invoke'
method of the BasicHandler class but does not change the content of the
message in it's context.

Can handlers change the Body payload of the message?  Could I do some XSLT
transformation on the payload in one handler before passing the context and
changed message on to the next handler in the chain?  Or can this only
happen in a handler which is the sole pivot point of the service?  Although
the Architecture guide states "a message is processed by passing through the
appropriate Chains. A message context is used to pass the message and
associated environment through the sequence of Handlers" it is not clear
what the intermediate handlers can do.

Many thanks if you can help.

James Carlyle

FableFlow : MMS templating and delivery
Multimedia Messaging commentary :

View raw message