Java, Validate XML against an embedded schema in WSDL
问题 I have a .wsdl file with an embedded schema. I want to validate an XML file/string using that .wsdl file (the same way you would validate against an .xsd ). The schema is between the <types> tag. I have this so far: public boolean validate(String xmlString) { try { // Convert to input stream InputStream xml = new ByteArrayInputStream(xmlString.getBytes()); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(new