Refine search
WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); wsdlWriter.writeWSDL(wsdlReader.readWSDL(null, argv[0]), System.out);
/** * Get a WSDLReader. * * @return WSDLReader. * @throws WSDLException * on error. */ private WSDLReader getReader() throws WSDLException { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry(); wsdlReader.setExtensionRegistry( registry ); wsdlReader.setFeature( "javax.wsdl.verbose", true ); wsdlReader.setFeature( "javax.wsdl.importDocuments", true ); return wsdlReader; }
private static Definition loadDefinition(String name) throws Exception { WSDLFactory factory = WSDLFactory.newInstance(); WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.importDocuments", false); reader.setFeature("javax.wsdl.verbose", false); Definition definition = reader.readWSDL(name); return definition; }
HttpURLConnection conn = (HttpURLConnection) new URL(requestURL + "?wsdl").openConnection(); conn.setRequestMethod("GET"); conn.connect(); WSDLReader newWSDLReader = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader(); DocumentBuilderFactory f = DocumentBuilderFactory.newInstance(); f.setNamespaceAware(true); Document doc = f.newDocumentBuilder().parse(inputStream); conn.disconnect(); Definition readWSDL = newWSDLReader.readWSDL(null, doc);
throws AxisFault { try { InputStream in = wsdlURL.openConnection().getInputStream(); Document doc = XMLUtils.newDocument(in); String namespaceURI = doc.getDocumentElement().getNamespaceURI(); if (Constants.NS_URI_WSDL11.equals(namespaceURI)) { WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); reader.setFeature("javax.wsdl.importDocuments", true); Definition wsdlDefinition = reader.readWSDL(getBaseURI(wsdlURL.toString()), doc); if (wsdlDefinition != null) { wsdlDefinition.setDocumentBaseURI(getDocumentURI(wsdlURL.toString()));
public WSDLServiceConfigurator(Service service, URL url, TransportManager transportManager) throws WSDLException, IOException { this(service, WSDLFactory.newInstance().newWSDLReader().readWSDL(null, new InputSource(url.openStream())), transportManager); }
try { WSDLReader wsdlReader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); InputStream is = wsdlFile.toURI().toURL().openStream(); Definition definition = wsdlReader.readWSDL(localOutputDirectory, new InputSource(is)); try {
try { InputSource inputSource = new InputSource(is); inputSource.setSystemId(wsdl.getURL().toString()); Definition def = WSDLUtils.createWSDL11Reader().readWSDL(wsdl.getURL().toString(), inputSource); if (validateWsdl) { WSIBPValidator validator = new WSIBPValidator(def); + port.getName() + "'"); description = WSDLUtils.getWSDL11Factory().newWSDLWriter().getDocument(def); marshaler.setBinding(BindingFactory.createBinding(port)); } finally {
public Definition readWSDL(String fileName) throws WSDLException { Definition wsdlDefinition = null; WSDLFactory factory = WSDLFactoryImpl.newInstance(); WSDLReader reader = factory.newWSDLReader(); try { File f = new File(fileName); URL url = null; if (f.exists()) { log.info(fileName + " as a local file doesn't exist."); url = f.toURI().toURL(); } else { url = ClassUtil.getResource(fileName, this.getClass()); } if (url==null){ log.info(fileName + " as a class path resource doesn't exist."); throw new WSDLException("null input", fileName); } URI uri = url.toURI(); WSDLLocator locator = new WSDLLocatorImpl(uri); wsdlDefinition = reader.readWSDL(locator); } catch (URISyntaxException e) { log.error(e.getMessage(), e); } catch (MalformedURLException ex) { log.error(ex.getMessage(), ex); } return wsdlDefinition; }
@SuppressWarnings("unchecked") @Override public void index(Contribution contribution, URL url, ValidationContext context) throws ContributionException { Resource resource = new Resource(url); contribution.addResource(resource); try { Definition definition = reader.readWSDL(resource.getUrl().toExternalForm()); for (Object object : definition.getPortTypes().keySet()) { QName portTypeName = (QName) object; PortTypeResourceElement resorceElement = new PortTypeResourceElement(portTypeName); resource.addResourceElement(resorceElement); } for (Object object : definition.getExtensibilityElements()) { ExtensibilityElement extensibilityElement = ExtensibilityElement.class.cast(object); ExtensionHandler extensionHandler = extensionHandlers.get(extensibilityElement.getClass()); if (extensionHandler != null) { extensionHandler.indexExtension(extensibilityElement, resource); } } } catch (WSDLException e) { throw new ContributionException(e); } }
/** * Gets the Definition contained in the WSDL document (does not currently support reading * WSDL that is protected with authentication). * @return Definition describing the service(s) * @throws Exception if the definition could not be read */ protected Definition getWSDLDefinition() throws Exception { return WSDLFactory.newInstance().newWSDLReader().readWSDL(getWsdlDocumentUrl()); }
/** * Initialize the component. */ @Init public final void initialize() throws FrascatiException { // Initialize the WSDL reader. try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); this.wsdlReader = wsdlFactory.newWSDLReader(); this.wsdlReader.setFeature("javax.wsdl.verbose", false); this.wsdlReader.setFeature("javax.wsdl.importDocuments", true); } catch (WSDLException we) { severe(new FrascatiException("Could not initialize WSDLReader", we)); } }
/** * Load and parse the WSDL file using the wsdlLocator. * * @param wsdlLocator * A WSDLLocator instance. * @param username * to use for authentication * @param password * to use for authentication * @return wsdl Definition. * @throws WSDLException * on error. */ private Definition parse( WSDLLocator wsdlLocator, String username, String password ) throws WSDLException, KettleException, AuthenticationException { WSDLReader wsdlReader = getReader(); try { return wsdlReader.readWSDL( wsdlLocator ); } catch ( WSDLException we ) { readWsdl( wsdlReader, wsdlURI.toString(), username, password ); return null; } }
/** * This will be called to configure the WSDLReader instance. */ public void configureReaderInstance(WSDLReader reader) throws WSDLException { // prevent the WSDLReader instance from using the System.out // stream for messages and logging reader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false); WSDLFactory factory = WSDLFactory.newInstance(); ExtensionRegistry extRegistry = reader.getExtensionRegistry(); if (extRegistry == null) { extRegistry = factory.newPopulatedExtensionRegistry(); } WSDLUtil.registerDefaultExtensionAttributeTypes(extRegistry); reader.setExtensionRegistry(extRegistry); }
public Definition readWSDLFile(String location) throws WSDLException { WSDLReader reader = getWsdlFactoryInstance().newWSDLReader(); reader.setFeature("javax.wsdl.importDocuments", true); return reader.readWSDL(location); }
public Definition cloneDefinition(WSDLFactory factory, Definition definition) throws WSDLException { Element root = definition.getDocumentationElement(); root = (Element)root.cloneNode(true); WSDLReader reader = factory.newWSDLReader(); return reader.readWSDL(definition.getDocumentBaseURI(), root); }
ExtensionRegistry extReg = null; try { extReg = WSDLFactory.newInstance().newPopulatedExtensionRegistry(); } catch (WSDLException e) { throw new ContextException("Could not create ExtensionRegistry.", e); new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION), AttributeExtensible.STRING_TYPE); r.setExtensionRegistry(extReg); URI uri = basedir.relativize(file.toURI()); try { tempDocRegistry.addDefinition((Definition4BPEL) r.readWSDL(new WSDLLocatorImpl(rf, uri))); } catch (WSDLException e) { throw new ContextException("Couldn't read WSDL document at " + uri, e);
public WSDLReader newReader() { WSDLReader reader = factory.newWSDLReader(); reader.setFeature(VERBOSE, false); ExtensionRegistry registry = createRegistry(); reader.setExtensionRegistry(registry); return reader; }
public static WSDLReader createWSDL11Reader() { WSDLReader reader = getWSDL11Factory().newWSDLReader(); reader.setFeature(Constants.FEATURE_VERBOSE, false); return reader; }