Hi I have created an .aar file and dropped in the WEB-INF/services directory of axis2 (1.6.2) war file. I deployed this to jboss 5.1 app server
I used the annotation "@Resource WebServiceContext" in the impl, but am not getting the WebServiceContext injected into the web service implementation class. The line where I try to use the context is throwing NullPointerException -------------------------------------------------- following are my artifacts used (1) HelloWorld interface _______________________ package com.bal.service; import javax.jws.WebMethod; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding.Use; @WebService @SOAPBinding(style=Style.DOCUMENT, use = Use.LITERAL) public interface HelloWorld { @WebMethod public String echo(String input); } _____________________________________________ (2) HelloWorldImpl _______ package com.bal.service; import javax.jws.WebService; @WebService(endpointInterface = "com.oneshield.service.HelloWorld") public class HelloWorldImpl implements HelloWorld { @Resource WebServiceContext ctx; @Override public String echo(String input) { // ctx is NULL here!! MessageContext mCtx = ctx.getMessageContext(); return "received "+ input ; } } __________________________________________ (3) services.xml ________ <serviceGroup> <service name="HelloService"> <Description>Hello web Service</Description> <parameter name="ServiceClass">com.bal.service.HelloWorldImpl</parameter> <messageReceivers> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> </messageReceivers> </service> </serviceGroup>