public Document getDocument(Definition wsdlDef) throws WSDLException { try { fixTypes(wsdlDef); } catch (Exception ex) { throw new WSDLException(WSDLException.PARSER_ERROR, ex.getMessage(), ex); } Document doc = wrapped.getDocument(wsdlDef); Element imp = null; Element child = DOMUtils.getFirstElement(doc.getDocumentElement()); //move extensability things to the top while (child != null) { if (child.getNamespaceURI().equals(doc.getDocumentElement().getNamespaceURI())) { //wsdl node if (imp == null) { imp = child; } } else if (imp != null) { doc.getDocumentElement().removeChild(child); doc.getDocumentElement().insertBefore(child, imp); } child = DOMUtils.getNextElement(child); } return doc; }
/** * Merges policy sets into the given WSDL document. * * @param wsdl the WSDL * @param policyExpressions the policy set expressions * @param mappings policy set to operation mappings * @return the merged WSDL * @throws GenerationException if the merge is unsuccessful */ private String mergePolicy(Definition wsdl, List<Element> policyExpressions, List<PolicyExpressionMapping> mappings) throws GenerationException { try { Document wsdlDocument = wsdlFactory.newWriter().getDocument(wsdl); policyAttacher.attach(wsdlDocument, policyExpressions, mappings); // Write the DOM representing the abstract WSDL back to the file Source source = new DOMSource(wsdlDocument); StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(source, result); return writer.toString(); } catch (TransformerException | WSDLException e) { throw new GenerationException(e); } }
/** * Return a DOM tree for the WSDL for a server. * * @param server the server. * @return the DOM tree. * @throws WSDLException */ public Document getWSDLDocument(Server server) throws WSDLException { Definition definition = getWSDLDefinition(server); WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); return writer.getDocument(definition); }
@Override public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); Document document = wsdlWriter.getDocument(definition); return new DOMSource(document); } catch (WSDLException ex) { throw new WsdlDefinitionException(ex.getMessage(), ex); } } }
@Override public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); Document document = wsdlWriter.getDocument(definition); return new DOMSource(document); } catch (WSDLException ex) { throw new WsdlDefinitionException(ex.getMessage(), ex); } } }
/** * Return a DOM tree for the WSDL for a server. * * @param server the server. * @return the DOM tree. * @throws WSDLException */ public Document getWSDLDocument(Server server) throws WSDLException { Definition definition = getWSDLDefinition(server); WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); return writer.getDocument(definition); }
@Override public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); Document document = wsdlWriter.getDocument(definition); return new DOMSource(document); } catch (WSDLException ex) { throw new WsdlDefinitionException(ex.getMessage(), ex); } } }
/** * Return a DOM tree for the WSDL for a server. * * @param server the server. * @return the DOM tree. * @throws WSDLException */ public Document getWSDLDocument(Server server) throws WSDLException { Definition definition = getWSDLDefinition(server); WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); return writer.getDocument(definition); }
public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); if (document == null) { try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); document = wsdlWriter.getDocument(definition); } catch (WSDLException ex) { throw new WsdlDefinitionException(ex.getMessage(), ex); } } } return new DOMSource(document); }
/** * @return Returns the description. */ public Document getDescription() { if (description == null) { definition = getDefinition(); if (definition != null) { try { description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition); } catch (WSDLException e) { // Ignore } } } return description; }
protected void mapDefinition(Definition def) throws WSDLException { addResource("main.wsdl", javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter().getDocument(def)); mapImports(def, ""); }
protected void mapImports(Definition def, String contextPath) throws WSDLException { // Add other imports to mapping Map imports = def.getImports(); for (Iterator iter = imports.values().iterator(); iter.hasNext();) { List imps = (List) iter.next(); for (Iterator iterator = imps.iterator(); iterator.hasNext();) { Import imp = (Import) iterator.next(); Definition impDef = imp.getDefinition(); String impLoc = imp.getLocationURI(); if (impDef != null && impLoc != null && !URI.create(impLoc).isAbsolute()) { impLoc = resolveRelativeURI(contextPath, impLoc); addResource(impLoc, javax.wsdl.factory.WSDLFactory.newInstance().newWSDLWriter().getDocument(impDef)); mapImports(impDef, getURIParent(impLoc)); } } } // Add schemas to mapping Types types = def.getTypes(); if (types != null) { for (Iterator it = types.getExtensibilityElements().iterator(); it.hasNext();) { ExtensibilityElement ee = (ExtensibilityElement) it.next(); if (ee instanceof Schema) { Schema schema = (Schema) ee; mapSchema(schema, ""); } } } }
description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
private static Document getWsdlDocument(Bus bus, Definition def) throws WSDLException { WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter(); def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry()); return wsdlWriter.getDocument(def); }
public Document toWSDL(String locationURI) throws WSDLException { WSDLFactory factory = WSDLFactory.newInstance(); Definition def = factory.newDefinition(); def.setTargetNamespace(TNS); def.addNamespace("xsd", XSD); def.addNamespace("tns", TNS); def.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/"); this.getWSDL(def, locationURI); return factory.newWSDLWriter().getDocument(def); }
WSDLFactory.newInstance().newWSDLWriter().getDocument(intf); doc = WSDLFactory.newInstance().newWSDLWriter().getDocument(impl);
opInfo.setProperty(WSDLServiceBuilder.WSDL_OPERATION, null); description = WSDLFactory.newInstance().newWSDLWriter().getDocument(swBuilder.build()); } catch (WSDLException ex) { throw new DeploymentException(ex);
WSDLFactory.newInstance().newWSDLWriter().getDocument(intf); doc = WSDLFactory.newInstance().newWSDLWriter().getDocument(impl);
.getWSDLFactory().newWSDLWriter(); def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry()); doc = wsdlWriter.getDocument(def);
.getWSDLFactory().newWSDLWriter(); def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry()); doc = wsdlWriter.getDocument(def);