use of javax.wsdl.factory.WSDLFactory in project cxf by apache.
the class WSDLGenerationTester method writeDefinition.
public File writeDefinition(File targetDir, File defnFile) throws Exception {
WSDLManager wm = BusFactory.getThreadDefaultBus().getExtension(WSDLManager.class);
WSDLFactory factory = WSDLFactory.newInstance("org.apache.cxf.tools.corba.utils.TestWSDLCorbaFactoryImpl");
WSDLReader reader = factory.newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", false);
reader.setExtensionRegistry(wm.getExtensionRegistry());
final String url = defnFile.toString();
CatalogWSDLLocator locator = new CatalogWSDLLocator(url, (Bus) null);
Definition wsdlDefn = reader.readWSDL(locator);
File bkFile = new File(targetDir, "bk_" + defnFile.getName());
try (Writer writer = Files.newBufferedWriter(bkFile.toPath())) {
factory.newWSDLWriter().writeWSDL(wsdlDefn, writer);
}
return bkFile;
}
use of javax.wsdl.factory.WSDLFactory in project cxf by apache.
the class JavaToProcessorTest method getDefinition.
private Definition getDefinition(String wsdl) throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
wsdlReader.setFeature("javax.wsdl.verbose", false);
return wsdlReader.readWSDL(wsdl);
}
use of javax.wsdl.factory.WSDLFactory in project tdi-studio-se by Talend.
the class AllTypeDialog method initSimpleType.
private void initSimpleType() throws WSDLException, URISyntaxException {
String url = URLValue;
XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader newWSDLReader = wsdlFactory.newWSDLReader();
newWSDLReader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false);
URI wsdlURI = new URI(url);
Definition definition = newWSDLReader.readWSDL(url);
java.util.List<ExtensibilityElement> extensibilityElements = definition.getTypes().getExtensibilityElements();
String tmpTNName = "";
int tmpCount = 0;
for (ExtensibilityElement el : extensibilityElements) {
if (el instanceof Schema) {
Schema schema = (Schema) el;
// for bug 8674
// set base uri for relative path in schemaLocation.
schemaCollection.setBaseUri(schema.getDocumentBaseURI());
if (schema.getElement().getAttributeNode("targetNamespace") == null) {
tmpTNName = schema.getDocumentBaseURI() + "#type" + tmpCount;
schemaCollection.read(schema.getElement(), tmpTNName);
tmpCount++;
} else {
schemaCollection.read(schema.getElement());
}
}
}
Map namespaces = definition.getNamespaces();
// System.out.println(namespaces);
XmlSchema[] schemas = schemaCollection.getXmlSchemas();
java.util.List<String> labelList = new ArrayList<String>();
for (int i = 0; i < schemas.length; i++) {
XmlSchema schema = schemas[i];
XmlSchemaObjectTable types = schema.getSchemaTypes();
Iterator it = types.getValues();
while (it.hasNext()) {
XmlSchemaType type = (XmlSchemaType) it.next();
if (type instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType t = (XmlSchemaSimpleType) type;
String label = "simpletype:" + t.getName();
if (!labelList.contains(label)) {
labelList.add(label);
labelAndNameSpaceMap.put(label, t.getQName().toString());
}
}
}
}
allXMLSimpleTypeName = new String[labelList.size()];
for (int i = 0; i < labelList.size(); i++) {
allXMLSimpleTypeName[i] = labelList.get(i);
}
}
use of javax.wsdl.factory.WSDLFactory in project Lucee by lucee.
the class JaxWSClient method loadWSDL.
private static Definition loadWSDL(URL url) throws WSDLException {
WSDLFactory factory = WSDLFactory.newInstance();
// create an object to read the WSDL file
WSDLReader reader = factory.newWSDLReader();
// pass the URL to the reader for parsing and get back a WSDL definiton
return reader.readWSDL(url.toExternalForm());
}
use of javax.wsdl.factory.WSDLFactory in project cxf by apache.
the class WSDLHelper method getDefinition.
public Definition getDefinition(File wsdlFile) throws Exception {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
return reader.readWSDL(wsdlFile.toURI().toURL().toString());
}
Aggregations