@Override public JBossWebservicesMetaData parse(URL url) { return new JBossWebservicesFactory(url).load(url); }
public JBossWebservicesMetaData parse(final InputStream is) { return parse(is, null); }
return new JBossWebservicesMetaData(contextRoot, configName, configFile, descriptorURL, props, jpcmds, jwsdmds); } else { throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName()); contextRoot = getElementText(reader); } else if (match(reader, nsUri, CONFIG_NAME)) { configName = getElementText(reader); } else if (match(reader, nsUri, CONFIG_FILE)) { configFile = getElementText(reader); } else if (match(reader, nsUri, PROPERTY)) { parseProperty(reader, nsUri, props); } else if (match(reader, nsUri, PORT_COMPONENT)) { jpcmds.add(parsePortComponent(reader, nsUri)); } else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) { jwsdmds.add(parseWebserviceDescription(reader, nsUri)); } else { throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName()); throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
/** * Load jboss-webservices.xml from <code>META-INF/jboss-webservices.xml</code> or <code>WEB-INF/jboss-webservices.xml</code> * . * * @param root virtual file root * @return JBossWebservicesMetaData or <code>null</code> if it cannot be found */ public JBossWebservicesMetaData loadFromVFSRoot(final UnifiedVirtualFile root) { JBossWebservicesMetaData webservices = null; UnifiedVirtualFile wsdd = root.findChildFailSafe("META-INF/jboss-webservices.xml"); // Maybe a web application deployment? if (null == wsdd) { wsdd = root.findChildFailSafe("WEB-INF/jboss-webservices.xml"); } // the descriptor is optional if (wsdd != null) { return load(wsdd.toURL()); } return webservices; }
private JBossWebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader reader, String nsUri) throws XMLStreamException { String webserviceDescriptionName = null; String wsdlPublishLocation = null; while (reader.hasNext()) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: { if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) { return new JBossWebserviceDescriptionMetaData(webserviceDescriptionName, wsdlPublishLocation); } else { throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName()); } } case XMLStreamConstants.START_ELEMENT: { if (match(reader, nsUri, WEBSERVICE_DESCRIPTION_NAME)) { webserviceDescriptionName = getElementText(reader); } else if (match(reader, nsUri, WSDL_PUBLISH_LOCATION)) { wsdlPublishLocation = getElementText(reader); } else { throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName()); } } } } throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs()); }
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 void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT); final URL jbossWebservicesDescriptorURL = getJBossWebServicesDescriptorURL(deploymentRoot); if (jbossWebservicesDescriptorURL != null) { final JBossWebservicesMetaData jbossWebservicesMD = JBossWebservicesFactory.load(jbossWebservicesDescriptorURL); unit.putAttachment(WSAttachmentKeys.JBOSS_WEBSERVICES_METADATA_KEY, jbossWebservicesMD); } }
throw MESSAGES.couldNotGetPropertyName(getDescriptorForLogs()); throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName()); name = getElementText(reader); value = getElementText(reader); throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName()); throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
URL jbwsURL = Classes.getResource(configFile, getClass()); try { JBossWebservicesFactory factory = new JBossWebservicesFactory(jbwsURL); jbwsMetadata = factory.load(jbwsURL); } catch (WebServiceException e) { if (LOGGER.isDebugEnabled()) {
authMethod, realmName, transportGuarantee, secureWsdlAccess); } else { throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(), reader.getLocalName()); ejbName = getElementText(reader); } else if (match(reader, nsUri, PORT_COMPONENT_NAME)) { portComponentName = getElementText(reader); } else if (match(reader, nsUri, PORT_COMPONENT_URI)) { portComponentURI = getElementText(reader); } else if (match(reader, nsUri, AUTH_METHOD)) { authMethod = getElementText(reader); } else if (match(reader, nsUri, REALM_NAME)) { realmName = getElementText(reader); } else if (match(reader, nsUri, TRANSPORT_GUARANTEE)) { transportGuarantee = getElementText(reader); } else if (match(reader, nsUri, SECURE_WSDL_ACCESS)) { secureWsdlAccess = elementAsBoolean(reader); } else { throw MESSAGES.unexpectedElement(getDescriptorForLogs(), reader.getLocalName()); throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
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 } }
URL jbwsURL = Classes.getResource(configFile, deploymentClassLoader, getClass().getClassLoader()); try { JBossWebservicesFactory factory = new JBossWebservicesFactory(jbwsURL); jbwsMetadata = factory.load(jbwsURL); } catch (WebServiceException e) { if (LOGGER.isDebugEnabled()) {
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); } }