PortInfo
HandlerResolver
This interface is never implemented by an application, only by a JAX-WS implementation. @since JAX-WS 2.0
107108109110111112113114115116117
} catch (TransformerConfigurationException e) { throw new ConfigurationException(e); } PortInfo portInfo = null; BindingType bindingType = (BindingType) _class.getAnnotation(BindingType.class); WebServiceProvider provider =
232233234235236237238239240241242
if (eic.getHandlers() == null) { if (log.isDebugEnabled()) { log.debug("No handlers found on the InvocationContext, initializing handler list."); } HandlerResolverImpl hri = new HandlerResolverImpl(endpointDesc.getServiceDescription()); PortInfo portInfo = endpointDesc.getPortInfo(); eic.setHandlers(hri.getHandlerChain(portInfo)); handlerRoles = hri.getRoles(portInfo); } // Get the service instance. This will run the @PostConstruct code.
244245246247248249250251252253254
service.setHandlerResolver(resolver); CalculatorPortType cal = (CalculatorPortType)service.getPort(PORT_1, CalculatorPortType.class); assertNotNull(cal); PortInfo info = resolver.getPortInfo(); assertNotNull(info); assertEquals(SERVICE_1, info.getServiceName()); assertEquals(PORT_1, info.getPortName()); assertEquals(SOAPBinding.SOAP12HTTP_BINDING, info.getBindingID()); }
260261262263264265266267268269270
235236237238239240241242243244245
if (eic.getHandlers() == null) { if (log.isDebugEnabled()) { log.debug("No handlers found on the InvocationContext, initializing handler list."); } HandlerResolverImpl hri = new HandlerResolverImpl(endpointDesc.getServiceDescription()); PortInfo portInfo = endpointDesc.getPortInfo(); eic.setHandlers(hri.getHandlerChain(portInfo)); handlerRoles = hri.getRoles(portInfo); } //Lets Initialize the understood QName here, add only the headers that the handler //injects when we invoke the getHeader().
316317318319320321322323324325326
String addedRole = soapRoles.get(0).getValue(); assertEquals(roleHandlerAdded, addedRole); // Now verify the role information in the handler config file correctly affects the // roles played returned from the Resolver PortInfo portInfo = epDesc.getPortInfo(); List<String> handlerRoles = handlerResolver.getRoles(portInfo); assertNotNull(handlerRoles); assertEquals(1, handlerRoles.size()); assertEquals(roleHandlerAdded, handlerRoles.get(0));
356357358359360361362363364365366
assertTrue(checkRoles.contains(roleHandlerAdded)); assertTrue(checkRoles.contains(roleHandlerAdded2)); // Now verify the role information in the handler config file correctly affects the // roles played returned from the Resolver PortInfo portInfo = epDesc.getPortInfo(); List<String> handlerRoles = handlerResolver.getRoles(portInfo); assertNotNull(handlerRoles); assertEquals(2, handlerRoles.size()); ArrayList<String> checkResolverRoles = new ArrayList<String>();
6970717273747576
public PortInfo getPortInfo() { QName serviceName = getServiceMetaData().getServiceName(); QName portName = getPortName(); String bindingID = getBindingId(); PortInfo portInfo = new PortInfoImpl(serviceName, portName, bindingID); return portInfo; }
139140141142143144145146
return status; } private List<Handler> getHandlerChain(EndpointMetaData epMetaData, HandlerType type) { PortInfo info = getPortInfo(epMetaData); return resolver.getHandlerChain(info, type); }
148149150151152153154155
private PortInfo getPortInfo(EndpointMetaData epMetaData) { QName serviceName = epMetaData.getServiceMetaData().getServiceName(); QName portName = epMetaData.getPortName(); String bindingId = epMetaData.getBindingId(); PortInfo info = new PortInfoImpl(serviceName, portName, bindingId); return info; }