use of com.sun.tools.ws.wsdl.document.WSDLDocument in project metro-jax-ws by eclipse-ee4j.
the class WSDLParserTest method testParseUsingPolicyRequired.
public void testParseUsingPolicyRequired() throws Exception {
final ErrorReceiverFilter errorReceiver = createErrorReceiver();
final InputSource source = getResourceSource("usingpolicy-required.wsdl");
final WsimportOptions options = new WsimportOptions();
options.addWSDL(source);
final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
final WSDLDocument wsdl = instance.parse();
assertNotNull(wsdl);
assertFalse(errorReceiver.hadError());
}
use of com.sun.tools.ws.wsdl.document.WSDLDocument in project metro-jax-ws by eclipse-ee4j.
the class WSDLParserTest method testParseSimple.
public void testParseSimple() throws Exception {
final ErrorReceiverFilter errorReceiver = createErrorReceiver();
final InputSource source = getResourceSource("simple.wsdl");
final WsimportOptions options = new WsimportOptions();
options.addWSDL(source);
final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
final WSDLDocument wsdl = instance.parse();
assertNotNull(wsdl);
assertFalse(errorReceiver.hadError());
}
use of com.sun.tools.ws.wsdl.document.WSDLDocument in project metro-jax-ws by eclipse-ee4j.
the class WSDLParserTest method testParseUsingPolicy.
public void testParseUsingPolicy() throws Exception {
final ErrorReceiverFilter errorReceiver = createErrorReceiver();
final InputSource source = getResourceSource("usingpolicy.wsdl");
final WsimportOptions options = new WsimportOptions();
options.addWSDL(source);
final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
final WSDLDocument wsdl = instance.parse();
assertNotNull(wsdl);
assertFalse(errorReceiver.hadError());
}
use of com.sun.tools.ws.wsdl.document.WSDLDocument in project metro-jax-ws by eclipse-ee4j.
the class WSDLParser method parse.
public WSDLDocument parse() throws SAXException, IOException {
// parse external binding files
for (InputSource value : options.getWSDLBindings()) {
errReceiver.pollAbort();
Document root = forest.parse(value, false);
// error must have been reported
if (root == null)
continue;
Element binding = root.getDocumentElement();
if (!Internalizer.fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) || !binding.getLocalName().equals("bindings")) {
errReceiver.error(forest.locatorTable.getStartLocation(binding), WsdlMessages.PARSER_NOT_A_BINDING_FILE(binding.getNamespaceURI(), binding.getLocalName()));
continue;
}
NodeList nl = binding.getElementsByTagNameNS("https://jakarta.ee/xml/ns/jakartaee", "handler-chains");
for (int i = 0; i < nl.getLength(); i++) {
options.addHandlerChainConfiguration((Element) nl.item(i));
}
// fallback to pre-jakarta version
nl = binding.getElementsByTagNameNS("http://java.sun.com/xml/ns/javaee", "handler-chains");
for (int i = 0; i < nl.getLength(); i++) {
options.addHandlerChainConfiguration((Element) nl.item(i));
}
}
return buildWSDLDocument();
}
Aggregations