def = bus.getExtension(WSDLManager.class).getDefinition(wsdlLocation); new WSDLGetUtils().updateWSDLPublishedEndpointAddress(def, endpointInfo);
public static List<Element> getSchemas(Server server, String id) { Message message = PhaseInterceptorChain.getCurrentMessage(); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); Map<String, String> locs = utils.getSchemaLocations(message, base, ctxUri, info); List<Element> ret = new LinkedList<>(); for (Map.Entry<String, String> xsd : locs.entrySet()) { if (StringUtils.isEmpty(id) || id.equals(xsd.getKey())) { String query = xsd.getValue().substring(xsd.getValue().indexOf('?') + 1); Map<String, String> params = UrlUtils.parseQueryString(query); ret.add(utils.getDocument(message, base, params, ctxUri, info).getDocumentElement()); } } return ret; }
public static List<Element> getSchemas(Server server, String id) { Message message = PhaseInterceptorChain.getCurrentMessage(); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); Map<String, String> locs = utils.getSchemaLocations(message, base, ctxUri, info); List<Element> ret = new LinkedList<>(); for (Map.Entry<String, String> xsd : locs.entrySet()) { if (StringUtils.isEmpty(id) || id.equals(xsd.getKey())) { String query = xsd.getValue().substring(xsd.getValue().indexOf('?') + 1); Map<String, String> params = UrlUtils.parseQueryString(query); ret.add(utils.getDocument(message, base, params, ctxUri, info).getDocumentElement()); } } return ret; }
public static List<Element> getWSDLs(Server server) { Message message = PhaseInterceptorChain.getCurrentMessage(); message.put(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL, true); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); List<Element> ret = new LinkedList<>(); for (String id : utils.getWSDLIds(message, base, ctxUri, info)) { Map<String, String> params = new HashMap<>(); params.put("wsdl", id); ret.add(utils.getDocument(message, base, params, ctxUri, info).getDocumentElement()); } return ret; }
public static List<Element> getWSDLs(Server server) { Message message = PhaseInterceptorChain.getCurrentMessage(); message.put(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL, true); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); List<Element> ret = new LinkedList<>(); for (String id : utils.getWSDLIds(message, base, ctxUri, info)) { Map<String, String> params = new HashMap<>(); params.put("wsdl", id); ret.add(utils.getDocument(message, base, params, ctxUri, info).getDocumentElement()); } return ret; }
private Document getDocument(Message message, String base, Map<String, String> params, String ctxUri) { // cannot have two wsdl's being generated for the same endpoint at the same // time as the addresses may get mixed up // For WSDL's the WSDLWriter does not share any state between documents. // For XSD's, the WSDLGetUtils makes a copy of any XSD schema documents before updating // any addresses and returning them, so for both WSDL and XSD this is the only part that needs // to be synchronized. synchronized (message.getExchange().getEndpoint()) { return new WSDLGetUtils().getDocument(message, base, params, ctxUri, message.getExchange().getEndpoint().getEndpointInfo()); } }
public static Map<String, String> getSchemaLocations(Server server) { Message message = PhaseInterceptorChain.getCurrentMessage(); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); return utils.getSchemaLocations(message, base, ctxUri, info); }
public static Map<String, String> getSchemaLocations(Server server) { Message message = PhaseInterceptorChain.getCurrentMessage(); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); return utils.getSchemaLocations(message, base, ctxUri, info); }
def = bus.getExtension(WSDLManager.class).getDefinition(wsdlLocation); new WSDLGetUtils().updateWSDLPublishedEndpointAddress(def, endpointInfo);
utils = new WSDLGetUtils(); message.put(WSDLGetUtils.class, utils);
utils = new WSDLGetUtils(); message.put(WSDLGetUtils.class, utils);
@Test public void testNewDocumentIsCreatedForEachWsdlRequest() { JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setServiceBean(new StuffImpl()); factory.setAddress("http://localhost:" + PORT + "/Stuff"); Server server = factory.create(); try { Message message = new MessageImpl(); Exchange exchange = new ExchangeImpl(); exchange.put(Bus.class, getBus()); exchange.put(Service.class, server.getEndpoint().getService()); exchange.put(Endpoint.class, server.getEndpoint()); message.setExchange(exchange); Map<String, String> map = UrlUtils.parseQueryString("wsdl"); String baseUri = "http://localhost:" + PORT + "/Stuff"; String ctx = "/Stuff"; WSDLGetUtils utils = new WSDLGetUtils(); Document doc = utils.getDocument(message, baseUri, map, ctx, server.getEndpoint().getEndpointInfo()); Document doc2 = utils.getDocument(message, baseUri, map, ctx, server.getEndpoint().getEndpointInfo()); assertFalse(doc == doc2); } finally { server.stop(); } } }