Skip to content

Commit

Permalink
SAVARA-356 Changed to use wsdl import
Browse files Browse the repository at this point in the history
  • Loading branch information
objectiser committed Aug 30, 2012
1 parent fbb63bc commit 74c543e
Showing 1 changed file with 4 additions and 15 deletions.
Expand Up @@ -338,15 +338,6 @@ protected void importSchemas(IResource resource, Contract contract,
if (contract.getNamespaces().size() > 0) {
org.w3c.dom.Element defnElem=doc.getDocumentElement();

// Added types node
org.w3c.dom.Element types=doc.createElementNS("http://schemas.xmlsoap.org/wsdl/",
"types");

org.w3c.dom.Element schema=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
"schema");

types.appendChild(schema);

// Generate imports for specified message schema
for (Namespace ns : contract.getNamespaces()) {

Expand All @@ -359,13 +350,13 @@ protected void importSchemas(IResource resource, Contract contract,
String location=st.nextToken();
IFile file=resource.getParent().getFile(new Path(location));

org.w3c.dom.Element imp=doc.createElementNS("http://www.w3.org/2001/XMLSchema",
org.w3c.dom.Element imp=doc.createElementNS("http://schemas.xmlsoap.org/wsdl/",
"import");

imp.setAttribute("namespace", ns.getURI());

if (file.exists()) {
imp.setAttribute("schemaLocation", file.getProjectRelativePath().toPortableString());
imp.setAttribute("location", file.getProjectRelativePath().toPortableString());

// Copy schema file into generated BPEL project
IPath artifactPath=bpelFolderPath.append(file.getProjectRelativePath());
Expand All @@ -374,15 +365,13 @@ protected void importSchemas(IResource resource, Contract contract,

copySchema(file, artifactFile, bpelFolderPath);
} else {
imp.setAttribute("schemaLocation", location);
imp.setAttribute("location", location);
}

schema.appendChild(imp);
defnElem.insertBefore(imp, defnElem.getFirstChild());
}
}
}

defnElem.insertBefore(types, defnElem.getFirstChild());
}
}

Expand Down

0 comments on commit 74c543e

Please sign in to comment.