Hello,

Setup:
Spring 2.5 (Configured using annotations)
CXF 2.0.3
Tomcat 6.0.14


I need to access the HTTPServletRequest from the web service impl class. I
have had a look at all the docs which say to add the code: 

@Resource
private WebServiceContext context;

which the request can be retrieved. However in my setup I get the following
error:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No unique bean of type [javax.xml.ws.WebServiceContext] is defined:
Unsatisfied dependency of type [interface javax.xml.ws.WebServiceContext]:
expected at least 1 matching bean
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveDependency(AbstractAutowireCapableBeanFactory.java:417)
        at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:384)
        at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:463)
        at
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:123)
        at
org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:61)
        at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:259)
        ... 53 more


Can anybody explain what the problem is? The docs make it seem very simple.
I have setup the web.xml with
org.springframework.web.context.request.RequestContextListener.  

If this is not possible with my setup is there any other way to access the
request from the web service? I need to access the user information in
multiple places for each individual request?

Thanks.






-- 
View this message in context: 
http://www.nabble.com/Cannot-get-WebServiceContext-or-access-the-httpservletrequest-tp14657900p14657900.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to