[CXF-6168] Applying a patch from lucaspouzac with minor modifications; This closes #45