Is there any Java API/Library for creating (WSDL) and Xml Schemas ?
I did not find any forum specifically dedicated to Xml Schema, so I am trying this forum instead and hope it is okay (since schemas is a part of WSDL).
How should you programatically create Xml Schemas, and WSDL files that includes XML schemas ?
Is there any java library that can be used for creating Xml schemas ?
I also am interested in creating WSDL programmatically, and for this I thought I had found what I was looking for when I found WSDL4J:
However, this API does not seem to be able to create Schema files.
The interface "javax.wsdl.Definition" in that API include the following methods:
Also, in the interface "javax.wsdl.Definition" there is a method
However, I can not figure out how to use the returned "Types" interface to add the Xml Schema type definitions of the desired elements into the wsdl definition.
(I have been browsing around in the javadoc and been searching in the superinterfaces of "Types" for methods such as "addComplexType" and "addSequence" which I expected to exist...)
If you do not understand what I am looking for, here is an example of what I would like to do with some API for creating Xml Schemas:
Schema schema = new Schema();
Element element = new Element("note");
ComplexType complexType = new ComplexType();
Sequence sequence = new Sequence();
SomeXmlSchemaCreatorUtility.createXmlSchemaFile(new File("C:\myschema.xsd"), schema);
With the above kind of code (though, with the addition of some namespaces handling too) I would like to be able to create a schema file with this content:
Somehow, I really expect that it should be possible to create a schema with WSDL4J (or is it really useful with an API for creating WSDL without also being able to create Xml Schemas ?), kind of like this:
javax.wsdl.Definition wsdlDef = ...
// the above schema object was created as further above,
// however there is no addSchema method in WSDL4J's "javax.wsdl.Definition"