RampartReceiver should store current MessageContext to simplify access 
MessageContext from CallbackHandler
----------------------------------------------------------------------------------------------------------

                 Key: RAMPART-69
                 URL: https://issues.apache.org/jira/browse/RAMPART-69
             Project: Rampart
          Issue Type: Improvement
          Components: rampart-core
    Affects Versions: 1.3
         Environment: all
            Reporter: Bernhard Roider


RampartReceiver should store current MessageContext to simplify access 
MessageContext from CallbackHandler.

This Feature is simple to implement and opens many ways to customise 
CallbackHandler and TokenIssuer.

Possible solution;

public class RampartReceiver(..) {
...
   RampartEngine engine = new RampartEngine();
   Vector wsResult;
   MessageContext oldCtx = MessageContext.getCurrentMessageContext();
   try {
            // save current MessageContext
            MessageContext.setCurrentMessageContext(msgContext);

            wsResult = engine.process(msgContext);
            
        } catch (WSSecurityException e) {
            e.printStackTrace();
            throw new AxisFault(e.getMessage(), e);
        } catch (WSSPolicyException e) {
            e.printStackTrace();
            throw new AxisFault(e.getMessage(), e);
        } catch (RampartException e) {
            e.printStackTrace();
            throw new AxisFault(e.getMessage(), e);
        } finally {
           // restore old MessageContext
           MessageContext.setCurrentMessageContext(oldContext);

        }


P.S.: it would be better (for future Axis2 Version compatibility) if the 
RampartReceiver extends AbstractHandler

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to