use of javax.wsdl.Definition in project carbon-business-process by wso2.
the class ArchiveBasedHumanTaskDeploymentUnitBuilder method readInTheWSDLFile.
/**
* Read the WSDL file given the input stream for the WSDL source
*
* @param in WSDL input stream
* @param entryName ZIP file entry name
* @param fromRegistry whether the wsdl is read from registry
* @return WSDL Definition
* @throws javax.wsdl.WSDLException at parser error
*/
public static Definition readInTheWSDLFile(InputStream in, String entryName, boolean fromRegistry) throws WSDLException {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
// switch off the verbose mode for all usecases
reader.setFeature(HumanTaskConstants.JAVAX_WSDL_VERBOSE_MODE_KEY, false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition def;
Document doc;
try {
doc = XMLUtils.newDocument(in);
} catch (ParserConfigurationException e) {
throw new WSDLException(WSDLException.PARSER_ERROR, "Parser Configuration Error", e);
} catch (SAXException e) {
throw new WSDLException(WSDLException.PARSER_ERROR, "Parser SAX Error", e);
} catch (IOException e) {
throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e);
}
// Log when and from where the WSDL is loaded.
if (log.isDebugEnabled()) {
log.debug("Reading 1.1 WSDL with base uri = " + entryName);
log.debug(" the document base uri = " + entryName);
}
if (fromRegistry) {
throw new UnsupportedOperationException("This operation is not currently " + "supported in this version of WSO2 BPS.");
} else {
def = reader.readWSDL(entryName, doc.getDocumentElement());
}
def.setDocumentBaseURI(entryName);
return def;
}
use of javax.wsdl.Definition in project ofbiz-framework by apache.
the class ModelService method toWSDL.
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);
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class JBWS1505TestCase method testWSDLGeneration.
/**
* All methods on the SEI should be mapped.
*
* @throws Exception
*/
@Test
@RunAsClient
public void testWSDLGeneration() throws Exception {
Definition wsdl = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdlURL.toString());
Map<?, ?> services = wsdl.getAllServices();
// a simple port
assertTrue(services.size() == 1);
javax.wsdl.Service service = (javax.wsdl.Service) services.values().iterator().next();
javax.wsdl.Port port = (javax.wsdl.Port) service.getPorts().values().iterator().next();
// with five op's
assertTrue(port.getBinding().getBindingOperations().size() == 5);
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class JBWS1529TestCase method testWSDLReader.
@Test
@RunAsClient
public void testWSDLReader() throws Exception {
File wsdlFile = getResourceFile("jaxws/jbws1529/META-INF/wsdl/JBWS1529Service.wsdl");
assertTrue(wsdlFile.exists());
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdl = wsdlReader.readWSDL(wsdlFile.getAbsolutePath());
assertNotNull(wsdl);
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class EndpointTestCase method readWSDL.
private void readWSDL(URL wsdlURL) throws Exception {
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
assertNotNull(wsdlDefinition);
}
Aggregations