On 2/24/06, Thilina Gunarathne <[EMAIL PROTECTED]> wrote:
You can use MessageContext injection to access the context hierachy within a service.public class .....Skeleton {
private MessageContext msgContext;
public void init(MessageContext context) {
this.msgContext = context;
}
public OMElement XXOperation(OMElement requestElement) {
msgContext.getServiceContext().getConfigurationContext());
........
}
}
Thanks for the nice guide. Accessing context within a web service was the major problem if I am to use context to store information. This solved it :)
Got few more points to verify.
1) AFAIK Axis2 webservices are stateless. So is it possible to store the msgConext in a private variable?
2) How can I store the object containing monitoring information? Shall I add another variable to context or is there a more general way like a hashmap to store any object?
3) Is the configuration context is same for entire engine? That means can I
guarantee that I access the same instance of context from any where?
Thanks,
Chathura.