You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Samisa Abeysinghe (JIRA)" <ji...@apache.org> on 2010/12/21 13:14:01 UTC

[jira] Resolved: (RAMPART-69) RampartReceiver should store current MessageContext to simplify access MessageContext from CallbackHandler

     [ https://issues.apache.org/jira/browse/RAMPART-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Samisa Abeysinghe resolved RAMPART-69.
--------------------------------------

    Resolution: Duplicate

Same as https://issues.apache.org/jira/browse/RAMPART-65

> 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.


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