3 Replies Latest reply on May 25, 2011 8:14 AM by Gary Brown

    Invocation context

    Gary Brown Master



      Just been playing with the quickstart order demo and wanted to find out whether there will be some form of invocation context available to the component.


      The specific case I have in mind is for services exposed via web services, where the SOAP messages may have header properties that need to be passed through to the service implementation - and the same issue for when invoking a referenced service were header properties need to be provided that may be included in a subsequent SOAP message to an external web service.




        • 1. Re: Invocation context
          Gary Brown Master

          I see in the SCA Java annotations/API spec that its possible to set a ComponentContext that provides access to a RequestContext. Is this mechanism going to be supported?


          This allows access to the security subject - but unfortunately does not provide support for passing a general list of properties.


          Security is probably the main reason for accessing the header properties, so this may be adequate - but may be worth extending the RequestContext implementation to allow components access to generic properties?

          • 2. Re: Invocation context
            Keith Babo Master

            We will provide a mechanism for accessing the exchange context for an invocation for Bean services, but it's not there right now.  One solution would be to associate the context with a thread local which the CDI bean can inject into the bean implementation.  We will definitely want to support the ability to set/get arbitrary context properties since (as you mentioned) there are many use cases for adding additional context.  This applies to SOAP headers, but also to any other binding or implementation which accepts sideband information.  It's a bit of a nasty detail in integration, but there's no way to get around it.


            Incidentally, the context is already available to use if you are using the core Exchange APIs.  So a component has access to the context today.  We just haven't added a way to push this into Bean services.  Would you mind filing a JIRA so we can track this?


            Thanks for your great input, Gary.