Hi all,
I hava an WSDL file containing 4 schemas (defining
complex and simple types). I have tried to access those schemas, (see code
below) but it seems it only retrieves the first schema from the WSDL file.
Someone has any idea about it?
Thanks n advance,
Fran
.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl",
new XSDResourceFactoryImpl()); // Create a
resource set and load the main schema file into it. ResourceSet
resourceSet = new
ResourceSetImpl(); resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_LOCATION,
Boolean.TRUE); XSDResourceImpl xsdSchemaResource =
(XSDResourceImpl)resourceSet.getResource(URI.createDeviceURI(schemaURL),
true); for (Iterator resources =
resourceSet.getResources().iterator(); resources.hasNext(); /* no-op
*/) { // Return the first schema
object found Resource resource =
(Resource)resources.next(); if (resource instanceof
XSDResourceImpl) {
XSDResourceImpl xsdResource =
(XSDResourceImpl)resource; return
xsdResource.getSchema();
} }
.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
|