1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public WsdlsParser (String path) throws WsdlsParseException, JDOMException, IOException
{
//On crée une instance de SAXBuilder
SAXBuilder sxb = new SAXBuilder();
String Name;
try
{
//On crée un nouveau document JDOM avec en argument le fichier XML
//Le parsing est terminé ;)
document = sxb.build(new File(path));
//On initialise un nouvel élément racine avec l'élément racine du document.
root = document.getRootElement();
Name = root.getAttributeValue("name");
}
catch( java.net.ConnectException ce){
throw new WsdlsParseException("A remote WSDL file could not be opened.\n." +
ce.getMessage());
}
definition = new Definition();
definition.setName(Name);
setDefinition();
} |