You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/24 14:48:34 UTC

those pesky missing wsdl schema imports

Dan, 

 

I'd look at this today if you can give me any sort of running start
about where they go and what they look like.

 

--benson

 


RE: those pesky missing wsdl schema imports

Posted by Benson Margulies <bi...@basistech.com>.
I think we're on the wrong subject. The issue is some extra element in
the WSDL itself that says, 'import' this schema even though it's sitting
right here. Apparently, we get this wrong for both Aegis and JAXB. 

 

________________________________

From: Dan Diephouse [mailto:dan.diephouse@mulesource.com] 
Sent: Wednesday, October 24, 2007 10:36 AM
To: Benson Margulies
Cc: cxf-dev@incubator.apache.org
Subject: Re: those pesky missing wsdl schema imports

 

Benson Margulies wrote: 

Dan, 

 

I'd look at this today if you can give me any sort of running start
about where they go and what they look like.

 

--benson

 

Hi Benson,

The place I think you want to focus on is
AegisDatabinding.createSchemas. Thats where we create the schema
element:

Element e = new Element("schema", xsdPrefix, XmlConstants.XSD);

There is a Set<Type> objects which are in that schema namespace. You
should theoretically be able to loop through their dependencies and add
namespaces:

for (Type schemaType : entry.getValue()) {
  for (Type importedType : schemaType.getDependencies()) {
   String ns = importedType.getSchemaType().getNamespaceURI();
   if (ns != XSD_NS && ns != entry.getKey() &&
importHasNotAlreadyBeenAdded) {
     Element importEl = new Element("import", xsdPrefix,
XmlConstants.XSD);
     importEl.setAttribute(new Attribute("namespace", ns);
     e.addContent(importEl);
   }
}

Hope that helps,

- Dan



-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog