{code:title=MyReader.java|borderStyle=solid}
// Read WSDL 1.1 Definitions
public Definitions readDefinitions(URL wsdlUrl) {
// create factory: can be static
XmlContextFactory xmlContextFactory = new XmlContextFactory();
// create context: can be static
XmlContext xmlContext = xmlContextFactory.newContext();
// create generic reader: cannot be static!!! not thread safe!!!
XmlObjectReader reader = xmlContext.createReader();
// read wsdl 1.1 definitions from url
Definitions definitions = reader.readDocument(wsdlUrl, Definitions.class);
return definitions ;
}
{code}
// Read WSDL 1.1 Definitions
public Definitions readDefinitions(URL wsdlUrl) {
// create factory: can be static
XmlContextFactory xmlContextFactory = new XmlContextFactory();
// create context: can be static
XmlContext xmlContext = xmlContextFactory.newContext();
// create generic reader: cannot be static!!! not thread safe!!!
XmlObjectReader reader = xmlContext.createReader();
// read wsdl 1.1 definitions from url
Definitions definitions = reader.readDocument(wsdlUrl, Definitions.class);
return definitions ;
}
{code}