/** * Set a map of from URI to prefix. If possible, the data binding will use these * prefixes on the wire. * * @param namespaceMap The namespaceMap to set. */ public void setNamespaceMap(Map<String, String> namespaceMap) { checkNamespaceMap(namespaceMap); this.namespaceMap = namespaceMap; }
d = copy(d); copied = true; ns = serviceInfo.getInterface().getName().getNamespaceURI(); d = doEmptyNamespaceHack(d, copied); d = copy(d); e.removeAttribute("schemaLocation"); updateSchemaLocation(e); if (StringUtils.isEmpty(e.getAttribute("namespace"))) { e.setAttribute("namespace", serviceInfo.getInterface().getName()
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private Document doEmptyNamespaceHack(Document d, boolean alreadyWritable) { boolean hasStuffToRemove = false; Element el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { hasStuffToRemove = true; break; } el = DOMUtils.getNextElement(el); } if (hasStuffToRemove) { // create a copy of the dom so we // can modify it. if (!alreadyWritable) { d = copy(d); } el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { d.getDocumentElement().removeChild(el); el = DOMUtils.getFirstElement(d.getDocumentElement()); } else { el = DOMUtils.getNextElement(el); } } } return d; }
d = copy(d); copied = true; ns = serviceInfo.getInterface().getName().getNamespaceURI(); d = doEmptyNamespaceHack(d, copied); d = copy(d); e.removeAttribute("schemaLocation"); updateSchemaLocation(e); if (StringUtils.isEmpty(e.getAttribute("namespace"))) { e.setAttribute("namespace", serviceInfo.getInterface().getName()
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private Document doEmptyNamespaceHack(Document d, boolean alreadyWritable) { boolean hasStuffToRemove = false; Element el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { hasStuffToRemove = true; break; } el = DOMUtils.getNextElement(el); } if (hasStuffToRemove) { // create a copy of the dom so we // can modify it. if (!alreadyWritable) { d = copy(d); } el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { d.getDocumentElement().removeChild(el); el = DOMUtils.getFirstElement(d.getDocumentElement()); } else { el = DOMUtils.getNextElement(el); } } } return d; }
d = copy(d); copied = true; ns = serviceInfo.getInterface().getName().getNamespaceURI(); d = doEmptyNamespaceHack(d, copied); d = copy(d); e.removeAttribute("schemaLocation"); updateSchemaLocation(e); if (StringUtils.isEmpty(e.getAttribute("namespace"))) { e.setAttribute("namespace", serviceInfo.getInterface().getName()
/** * Set a map of from URI to prefix. If possible, the data binding will use these * prefixes on the wire. * * @param namespaceMap The namespaceMap to set. */ public void setNamespaceMap(Map<String, String> namespaceMap) { checkNamespaceMap(namespaceMap); this.namespaceMap = namespaceMap; }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<DOMSource>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private Document doEmptyNamespaceHack(Document d, boolean alreadyWritable) { boolean hasStuffToRemove = false; Element el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { hasStuffToRemove = true; break; } el = DOMUtils.getNextElement(el); } if (hasStuffToRemove) { // create a copy of the dom so we // can modify it. if (!alreadyWritable) { d = copy(d); } el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { d.getDocumentElement().removeChild(el); el = DOMUtils.getFirstElement(d.getDocumentElement()); } else { el = DOMUtils.getNextElement(el); } } } return d; }
d = copy(d); copied = true; ns = serviceInfo.getInterface().getName().getNamespaceURI(); d = doEmptyNamespaceHack(d, copied); d = copy(d); e.removeAttribute("schemaLocation"); updateSchemaLocation(e); if (StringUtils.isEmpty(e.getAttribute("namespace"))) { e.setAttribute("namespace", serviceInfo.getInterface().getName()
/** * Set a map of from URI to prefix. If possible, the data binding will use these * prefixes on the wire. * * @param namespaceMap The namespaceMap to set. */ public void setNamespaceMap(Map<String, String> namespaceMap) { checkNamespaceMap(namespaceMap); this.namespaceMap = namespaceMap; }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<DOMSource>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private Document doEmptyNamespaceHack(Document d, boolean alreadyWritable) { boolean hasStuffToRemove = false; Element el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { hasStuffToRemove = true; break; } el = DOMUtils.getNextElement(el); } if (hasStuffToRemove) { // create a copy of the dom so we // can modify it. if (!alreadyWritable) { d = copy(d); } el = DOMUtils.getFirstElement(d.getDocumentElement()); while (el != null) { if ("import".equals(el.getLocalName()) && StringUtils.isEmpty(el.getAttribute("targetNamespace"))) { d.getDocumentElement().removeChild(el); el = DOMUtils.getFirstElement(d.getDocumentElement()); } else { el = DOMUtils.getNextElement(el); } } } return d; }
/** * Set a map of from URI to prefix. If possible, the data binding will use these * prefixes on the wire. * * @param namespaceMap The namespaceMap to set. */ public void setNamespaceMap(Map<String, String> namespaceMap) { checkNamespaceMap(namespaceMap); this.namespaceMap = namespaceMap; }