Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Included Schema not resolved in WSDL?
Included Schema not resolved in WSDL? [message #585746] Sun, 18 April 2004 06:46
Adam Ratcliffe is currently offline Adam RatcliffeFriend
Messages: 3
Registered: July 2009
Junior Member
Hi all,

I'm wanting to use the XSD library to parse a wsdl document and gain access
to all of the defined types, both those
embedded in the wsdl document itself, and also those defined in an external
xsd document referenced by an
<include> element. When I write out the names of all of the complex type
definitions I see those defined in the main
document but not those from the external document.

I thought this could be a quirk related to parsing a wsdl document so I
rewrote my test case to use an xsd document with
an included schema and got the same result.

I've included my test case below, perhaps someone can point out where I'm
going wrong with this?

Thanks in advance,

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "wsdl",
new XSDResourceFactoryImpl());
String uri = "xml/wsdl/Party.wsdl";
ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdSchemaResource = (XSDResourceImpl)
resourceSet.getResource(URI.createDeviceURI(uri), true);

Iterator resources = resourceSet.getResources().iterator();
while (resources.hasNext()) {
Resource res = (Resource);
if (res instanceof XSDResourceImpl) {
XSDResourceImpl xsdResource = (XSDResourceImpl) res;
XSDSchema schema = xsdResource.getSchema();

List allTypes = schema.getTypeDefinitions();
for (Iterator iter = allTypes.iterator(); iter.hasNext();) {
XSDTypeDefinition typedef = (XSDTypeDefinition);
if (typedef instanceof XSDComplexTypeDefinition) {
String name = typedef.getName();
Previous Topic:Getting elements II
Next Topic:Included Schema not resolved in WSDL?
Goto Forum:

Current Time: Mon Oct 26 08:40:32 GMT 2020

Powered by FUDForum. Page generated in 0.01712 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top