Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MessageContext is null

Balaji Sundararaju
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create a webservice using CXF and REST framework. I created a Servlet Client which runs on Weblogic server 10. And I have the Webservice Method running on another Weblogic Server 10.

I followed the JAX-RS example provided in this link, Communication between my client and the webservice is working as expected. To get to the next step I was trying to get an handle over the request and session object in my webservices server end.

After going thro couple of examples, I used the below code snippet and I'm able to get hold of the WebServiceContext.

private WebServiceContext context;

My problem is when I'm trying to get a Message Context, it is returning me null. Please let me know what I'm missing here.

Below is my beans.xml code:

<beans xmlns=""

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

<jaxrs:server id="shoppingbagservice" address="/">
<ref bean="shoppingBean" />

<bean id="shoppingBean" class="" />

Let me know if you need more information on this.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!