public JBossWebservicesMetaData parse(final InputStream is) { return parse(is, null); }
private JBossWebservicesMetaData parse(final XMLStreamReader reader, final URL descriptorURL) throws XMLStreamException { int iterate; try { iterate = reader.nextTag(); } catch (XMLStreamException e) { // skip non-tag elements iterate = reader.nextTag(); } JBossWebservicesMetaData metadata = null; switch (iterate) { case END_ELEMENT: { // we're done break; } case START_ELEMENT: { if (match(reader, JBOSSEE_NS, WEBSERVICES)) { String nsUri = reader.getNamespaceURI(); metadata = parseWebservices(reader, nsUri, descriptorURL); } else { throw MESSAGES.unexpectedElement(descriptorURL != null ? descriptorURL.toString() : "jboss-webservices.xml", reader.getLocalName()); } } } return metadata; }
public JBossWebservicesMetaData load(final URL wsddUrl) { InputStream is = null; try { is = wsddUrl.openStream(); XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is); return parse(xmlr, wsddUrl); } catch (Exception e) { throw MESSAGES.failedToUnmarshall(e, wsddUrl); } finally { try { if (is != null) is.close(); } catch (IOException e) { } // ignore } }
public JBossWebservicesMetaData parse(final InputStream is, final URL descriptorURL) { try { final XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is); return parse(xmlr, descriptorURL); } catch (Exception e) { throw new WebServiceException(e); } }