Wsdl4jDefinition implements Wsdl11Definition { @Override public Source getSource() { synchronized (monitor) { Assert.notNull(definition, "definition must not be null"); try { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); Document document = wsdlWriter.getDocument(definition); return new DOMSource(document); } catch (WSDLException ex) { throw new WsdlDefinitionException(ex.getMessage(), ex); } } } Wsdl4jDefinition();  Wsdl4jDefinition(Definition definition); Definition getDefinition(); void setDefinition(Definition definition); @Override Source getSource(); String toString();  }
@Test public void testGetSource() throws Exception { Source source = definition.getSource(); Assert.assertNotNull("Source is null", source); DOMResult result = new DOMResult(); transformer.transform(source, result); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactoryUtils.newInstance(); documentBuilderFactory.setNamespaceAware(true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document expected = documentBuilder.parse(getClass().getResourceAsStream("complete.wsdl")); assertXMLEqual(expected, (Document) result.getNode()); }