Hi Rishi ,
JAX-WS programing model is different from native Axis2 programing
model , you cant use MessageContext.getCurrentMessageContext() method
with JAX-WS , instead of you can use following steps.
1.) Inject WebServiceContext in to your service implementation class
using @Resource annotation.
@Resource(type=WebServiceContext.class)
public WebServiceContext context;
2.) In your service method access to MessageContext through
getMessageContext() method on WebServiceContext interface.
MessageContext msgCtx = context.getMessageContext();
Also note that this "msgCtx " object type is
javax.xml.ws.handler.MessageContext not
org.apache.axis2.context.MessageContext .
Thanks,
On Thu, May 28, 2009 at 10:59 PM, Kapur, Rajneesh
<[email protected]> wrote:
> Hi Sagar,
>
> My query is also related. I have JAX-WS style webService where I want to get
> access to "raw xml as received" in my service (idea is to log the whole raw
> message untouched as the first step).
>
> So I thought if I can get MessageContext - then I can use msgCtx.getEnvelope
> and log it. However, when I do
>
> MessageContext msgCtx = MessageContext.getCurrentMessageContext();
>
> msgCtx is null - also as we know since its JAX-WS style service - I don't
> have service.xml file and I created myService.jar file and deployed in
> "servicejars" folder. I really appreciate your help.
>
> Regards,
> rishi
>
> ________________________________
> IMPORTANT WARNING: Information contained in this email is intended for the
> use of the individual to whom it is addressed, and may contain information
> that is privileged, confidential, and exempt from disclosure under
> applicable law. If you are not the intended recipient, or the employee or
> agent responsible for delivering the message to the intended recipient, you
> are hereby notified that any dissemination, distribution, or copying of this
> communication is STRICTLY FORBIDDEN. If you have received this communication
> in error, please notify us immediately by return email and delete this
> document. Thank you.
>
--
Sagara Gunathunga
Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/