@Resource for accessing MessageContext
--------------------------------------

         Key: XFIRE-317
         URL: http://jira.codehaus.org/browse/XFIRE-317
     Project: XFire
        Type: Improvement

  Components: Annotations  
    Versions: 1.0    
    Reporter: Kalle Korhonen
 Assigned to: Dan Diephouse 
    Priority: Minor


Instead of auto-magic MessageContext parameter, @Resource would be a more 
natural way of accessing the MessageContext in the operation when using 
annotations. Java6 adds javax.xml.ws.WebServiceContext and together with 
java.annotation.Resource you can use it as:
@Resource(type=Object.class)
private WebServiceContext wsContext;
MessageContext context = wsContext.getMessageContext();

Yours could be an implementation of it for Java5 or something along these 
lines. Copying the discussion on the email below:

----
Dan Diephouse   
<[EMAIL PROTECTED]> to user
         More options     9:32 am (8 minutes ago)
The @Resource is probably a much better way. Could you open a JIRA issue
for this? Thanks!

One option you do have is to write your own Invoker and pass along the
MessageContext whatever way you want to your service.

- Dan
- Hide quoted text -

Kalle Korhonen wrote:

>Hello XFire users,
>
>I'm new to XFire, but this stuff rocks. Got basic authentication
>working with XFire using JSR181, and I'd need to know the username
>within the operation. The documentation says you can simply add
>MessageContext as a parameter to your operation, and indeed this seems
>to work but this forces me to add it to the interface as well(?). On
>the (Java) client, it looks a little ugly now that I'm reusing the
>same interface and passing in an additional null with each operation
>(that are user specific) but then "mysteriously" on the server I get
>an existing MessageContext object. Are the any chances/plans to change
>this to use @Resource annotation or some other undocumented way of
>doing this, or is this going to be it?
>
>Thanks for the project. It's so much cleaner after some Axis/WSDL hacking!
>
>Kalle

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to