WSE filters

  • Thread starter Thread starter Mike Schilling
  • Start date Start date
M

Mike Schilling

Today was my first experience using WSE filters in SOAP clients. One of
the simpler things I wanted to create was an OutputFilter/InputFilter pair
that calculates response time by having the OutputFilter store the start
time in the SoapContext for the InputFilter to subtract from the end time.
Of course, I had assumed that the OutputFilter and InputFilter shared a
SoapContext (or at least its table of properties) and was very surprised to
find that this isn't the case. As it is, I don't see any way for the two
to communicate except via a ThreadLocal, which is both unnecessarily complex
and error-prone. Am I missing something?

Note that in JAX-RPC, which is the equivalent Java technology, the context
*is* shared between outbound and inbound filters, making this kind of thing
simple.
 
Mike,

Instead of attaching it to the context (I would try and learn more about
WSE if WCF wasn't coming out), can you alter the payload on the way in, and
then strip it on the way out? On the way in, you can attach your piece of
information, and then remove it on the way out.

It will increase processing time, of course, because you have to shred
and re-create the payload, but it should work.

Hope this helps.
 
Nicholas Paldino said:
Mike,

Instead of attaching it to the context (I would try and learn more
about WSE if WCF wasn't coming out), can you alter the payload on the way
in, and then strip it on the way out? On the way in, you can attach your
piece of information, and then remove it on the way out.

The payload on the way out is the SOAP request; on the way back in it's the
SOAP response. So no, unless I'm going to alter every service to echo this
information, that wouldn't work.
 
Back
Top