I will add one more line
..
Use this to get the request and respnse
message separately..
Message messageReq =
msgContext.getRequestMessage(); Message messageRes =
msgContext.getResponseMessage();
Cheers
Dhanush
----- Original Message -----
Sent: Wednesday, July 21, 2004 1:10
PM
Subject: RE: How do I get the underlying
request/response xml?
Are,
Try this in your
handler:
Message message =
msgContext.getCurrentMessage();
SOAPPart sPart =
(org.apache.axis.SOAPPart) message.getSOAPPart();
try
{
doc
=
((org.apache.axis.message.SOAPEnvelope)
sPart
.getEnvelope())
.getAsDocument();
} catch (Exception e)
{
throw new AxisFault("Cannot get SOAP envlope from message" +
e);
} }
/* put here
manipulation code on doc
*/
ByteArrayOutputStream os = new
ByteArrayOutputStream();
XMLUtils.outputDOM(doc, os,
true);
sPart.setCurrentMessage(os.toByteArray(), SOAPPart.FORM_BYTES);
The
XMLUtils class you get from the XML Security library (see
Apache project).
Yves
On Wed, 2004-07-21 at 09:18, Tysnes Are
Thobias wrote: > Hello! > > I have an additional question
to this topic. > > Has someone successfully added new child
elements to an existing element > in the Request from within a handler
!? > > I did try but the XML was no longer valid.. blanks and
newlines all > over the place.. -( > > Cheers, > Are
T. Tysnes > > -----Original Message----- > From: Mayur
Shetye [mailto:[EMAIL PROTECTED] > Sent: 19. juli 2004
23:54 > To: [EMAIL PROTECTED] >
Subject: RE: How do I get the underlying request/response xml? >
> > Hi > > You could add a server handler which
puts the incoming > SOAP message in a stream. > > What you
have in this stream is an xml document. You > can get the method name by
using the appropriate getElementByTagName( ) > method . By using this
method you can get the get the method name and then > make necessary
updates . > > Let me know if you get a better approach. >
> Thanks > mayur > > --- Vikas Phonsa <[EMAIL PROTECTED]> wrote: > > Not
sure what exactly you want to do. But have u > > taken a look a look
at the > > "tcpmon" program that comes with axis. It has
proved > > to be a lifesaver for > > me. > >
> > Vikas > > > > -----Original
Message----- > > From: Deppen, Jeff
[mailto:[EMAIL PROTECTED] > > Sent: Monday, July 19, 2004 2:24
PM > > To: '[EMAIL PROTECTED]' >
> Subject: How do I get the underlying > > request/response
xml? > > > > All, > > > > I need to
capture statistics/info for each of my > > methods. In addition
to > > capturing start and stop times, I also need the xml
request/response. > > Axis is great at parsing and converting
the soap message > > to/from java, however, > > by the time
I (my java code) get's control, the soap > > message is long
gone. > > How can I get to it? (I suppose I could do >
> something with log4j that > > filters out everything except for
the > > request/response soap messages but I'm > > concerned
this would introduce some serious > > performance issues.) >
> > > Any help/thoughts would be appreciated. > >
> > thanks > > jeff > > > > >
> > __________________________________ > Do you
Yahoo!? > Vote for the stars of Yahoo!'s next ad campaign! > http://advision.webevents.yahoo.com/yahoo/votelifeengine/
*********************************************************
Disclaimer:
This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.
*********************************************************
Visit us at http://www.mahindrabt.com
|
|