code: public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx)
     {
        final Class<?> instanceClass = instance.getClass();
  
        // inject @Resource annotated methods accepting WebServiceContext parameter
        Collection<Method> resourceAnnotatedMethods = WEB_SERVICE_CONTEXT_METHOD_FINDER.process(instanceClass);
        for(Method method : resourceAnnotatedMethods)
        {
           try
           {
              invokeMethod(instance, method, new Object[] {ctx});
           }
           catch (Exception e)
           {
              final String message = "Cannot inject @Resource annotated method: " + method;
              InjectionException.rethrow(message, e);
           }
        }
  
        // inject @Resource annotated fields of WebServiceContext type
        final Collection<Field> resourceAnnotatedFields = WEB_SERVICE_CONTEXT_FIELD_FINDER.process(instanceClass);
        for (Field field : resourceAnnotatedFields)
        {
           try
           {
              setField(instance, field, ctx);
           }
           catch (Exception e)
           {
              final String message = "Cannot inject @Resource annotated field: " + field;
              InjectionException.rethrow(message, e);
           }
        }
     }
docs: Injects @Resource annotated accessible objects referencing WebServiceContext.
  
  @param instance to operate on
  @param ctx current web service context