Hi, I have managed to fix it by engaging the module after adding the service to the configuration context. However, I am not sure whether the module is being engaged succesfully. I have the following policy applied to the service, however, the client is able to invoke the service without any security credentials.
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <sp:UsernameToken> <wsp:Policy> <sp:WssUsernameToken11/> </wsp:Policy> </sp:UsernameToken> </wsp:Policy> Ta Meeraj On 12/17/07, Meeraj Kunnumpurath <[EMAIL PROTECTED]> wrote: > Hi, > > I am embedding Axis2 in an application and trying to engage Rampart > dynamically using the code below, > > AxisService axisService = new AxisService(); > > axisService.setName(uri); > axisService.setClientSide(false); > axisService.setClassLoader(classLoader); > axisService.setEndpointURL(uri); > > Parameter interfaceParameter = > new Parameter(Constants.SERVICE_CLASS, serviceClass); > axisService.addParameter(interfaceParameter); > > setMessageReceivers(wire, axisService); > > AxisModule rampart = new AxisModule("rampart"); > axisService.engageModule(rampart); > > for (Element policyDefinition : pwsd.getPolicyDefinitions()) { > axisService.applyPolicy(policyBuilder.buildPolicy(policyDefinition)); > } > > configurationContext.getAxisConfiguration().addService(axisService); > > However, when I try to engage Rampart, I get the following exception, > any pointers would be highly appreciated. > > Caused by: java.lang.NullPointerException > at > org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:76) > at > org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:106) > at > org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:158) > at > org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:458) > at > org.apache.axis2.description.AxisService.onEngage(AxisService.java:689) > at > org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:458) > at > org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:421) > > Many thanks > Meeraj > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
