private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry, HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) { HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName); @SuppressWarnings("unchecked") // Can't change the API Iterator<Handler> iter = handlerChain.iterator(); while (iter.hasNext()) { Handler handler = iter.next(); handler.init(handlerInfo); } String[] soaprolesRegistered = handlerChain.getRoles(); String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()]; int i; for (i = 0;i < soaprolesRegistered.length; i++) soaproles[i] = soaprolesRegistered[i]; for (int j = 0; j < soaprolesToAdd.size(); j++) soaproles[i+j] = soaprolesToAdd.get(j); handlerChain.setRoles(soaproles); handlerRegistry.setHandlerChain(portName, handlerChain); }
public void invokeService (Map config, int interopNum) throws Exception { PingServiceLocator service = new PingServiceLocator(); List handlerChain = new ArrayList(); handlerChain.add(new HandlerInfo( WSS4JHandler.class, config, null)); HandlerRegistry registry = service.getHandlerRegistry(); registry.setHandlerChain(new QName("Ping" + interopNum), handlerChain); service.getHandlerRegistry().getHandlerChain(new QName("http://xmlsoap.org/Ping", "ticketType")); java.lang.reflect.Method method = service.getClass().getMethod("getPing" + interopNum, new Class[] {URL.class}); PingPort port = (PingPort) method.invoke (service, new Object[] {new URL("http://localhost:8080/axis/services/Ping" + interopNum)}); StringHolder text = new StringHolder("WSS4J - Scenario" + interopNum + " @ [" + new java.util.Date(System.currentTimeMillis()) + "]"); port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J" + interopNum), text); System.out.println(text.value); }
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry, HandlerInfo handlerref, ArrayList soaprolesToAdd) { HandlerChain handlerList = (HandlerChain) handlerRegistry.getHandlerChain(portName); handlerList.add(handlerref); String[] soaprolesRegistered = handlerList.getRoles(); String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()]; int i; for (i = 0;i < soaprolesRegistered.length; i++) soaproles[i] = soaprolesRegistered[i]; for (int j = 0; j < soaprolesToAdd.size(); j++) soaproles[i+j] = (String) soaprolesToAdd.get(j); handlerList.setRoles(soaproles); handlerRegistry.setHandlerChain(portName, handlerList); }
public HandlerRegistry getHandlerRegistry() { throw new UnsupportedOperationException(); }