Java Code Examples for javax.wsdl.Definition#createTypes()

The following examples show how to use javax.wsdl.Definition#createTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WSDLSchemaManager.java    From cxf with Apache License 2.0 5 votes vote down vote up
public void addWSDLSchemaImport(Definition def, String tns, File file) throws Exception {
    // REVISIT, check if the wsdl schema already exists.
    Types types = def.getTypes();
    if (types == null) {
        types = def.createTypes();
        def.setTypes(types);
    }
    Schema wsdlSchema = (Schema)def.getExtensionRegistry()
        .createExtension(Types.class, new QName(Constants.URI_2001_SCHEMA_XSD, "schema"));

    addWSDLSchemaImport(wsdlSchema, tns, file);
    types.addExtensibilityElement(wsdlSchema);
}
 
Example 2
Source File: WSDLASTVisitor.java    From cxf with Apache License 2.0 5 votes vote down vote up
public boolean writeSchemaDefinition(Definition definit, Writer writer) throws Exception  {
    Definition def = manager.createWSDLDefinition(targetNamespace + "-types");
    def.createTypes();
    def.setTypes(definit.getTypes());
    WSDLUtils.writeSchema(def, writer);
    return true;
}