Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2674

@Resource not injecting WebServiceContext in jaxws intereceptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.2.5
    • Invalid
    • None
    • tomcat 6.0.18, Spring 2.5, Spring Security 2.0.5, cxf-2.2.5 with wss4j-1.5.8

    Description

      If you want to inject the WebServiceContext into a In/Out-Interceptor configured with xml (e.g. <jaxws:ininterceptors><bean id="someInterceptor" class="test.SomeInterceptor"/></jaxws:ininterceptors />) with the @resource annotation, the WebServiceContext is null. (Even with component-scan enabled and annotation-config defined)

      If you inject the WebServiceContext into the interceptor with a property-setter in the xml (e.g. <property name="ctx" value="javax.xml.ws.WebServiceContext" />) the instance is not empty, but holding nothing (like MessageContext )

      The documentation suggest the way with the @Resource annotation, so this is rather confusing.

      The work-around I found, is to set the properties I wanted to set on the message in the handleMessage method of the interceptor (e.g. message.put("someKey", someValue); )
      I would rather see the @Resource injection working.

      Regards,

      Auke Noppe
      Developer @ Ymor (.nl)

      Attachments

        1. logging.log
          21 kB
          Auke Noppe
        2. webservicecontext_test.zip
          13 kB
          Auke Noppe

        Activity

          People

            dkulp Daniel Kulp
            anoppe Auke Noppe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: