WsdlXmlValidator extends SoapValidator { @IbisDoc({"the wsdl to read the xsd's from", " "}) public void setWsdl(String wsdl) throws ConfigurationException { this.wsdl = wsdl; WSDLReader reader = FACTORY.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); reader.setFeature("javax.wsdl.importDocuments", true); ClassLoaderWSDLLocator wsdlLocator = new ClassLoaderWSDLLocator(getConfigurationClassLoader(), wsdl); URL url = wsdlLocator.getUrl(); if (wsdlLocator.getUrl() == null) { throw new ConfigurationException("Could not find WSDL: " + wsdl); } try { definition = reader.readWSDL(wsdlLocator); } catch (WSDLException e) { throw new ConfigurationException("WSDLException reading WSDL or import from url: " + url, e); } if (wsdlLocator.getIOException() != null) { throw new ConfigurationException("IOException reading WSDL or import from url: " + url, wsdlLocator.getIOException()); } }  @IbisDoc({"the wsdl to read the xsd's from", " "}) void setWsdl(String wsdl); String getWsdl(); @Override void configure(); @Override String getSchemasId(); @Override Set<XSD> getXsds(); String toExtendedString(); @IbisDoc({"1", "pairs of uri references which will be added to the wsdl", " "}) void setSchemaLocationToAdd(String schemaLocationToAdd); String getSchemaLocationToAdd(); @IbisDoc({"2", "creates <code>schemalocation</code> attribute based on the wsdl and replaces the namespace of the soap body element", " " }) void setSoapBodyNamespace(String soapBodyNamespace); String getSoapBodyNamespace(); static final String RESOURCE_INTERNAL_REFERENCE_PREFIX; }
@Test public void warnSchemaLocationAlreadyDefaultValue() throws IOException, PipeRunException, SAXException, WSDLException, ConfigurationException, XmlValidatorException { IbisManager ibisManager = spy(new DefaultIbisManager()); ibisManager.setIbisContext(spy(new IbisContext())); Configuration configuration = new Configuration(new DummyAdapterService()); configuration.setName("dummyConfiguration"); configuration.setVersion("1"); configuration.setIbisManager(ibisManager); ConfigurationWarnings.getInstance().setActiveConfiguration(configuration); IAdapter adapter = spy(new Adapter()); adapter.setName("dummy"); PipeLine pl = new PipeLine(); pl.setFirstPipe("dummy"); WsdlXmlValidator val = new WsdlXmlValidator(); val.setName("dummy"); val.setWsdl(BASIC); val.setSoapHeader("MessageHeader"); val.setSoapBody("GetPolicyDetails_Request"); val.setAddNamespaceToSchema(true); val.setSchemaLocation("http: val.setThrowException(true); val.registerForward(new PipeForward("success", null)); pl.addPipe(val); PipeLineExit ple = new PipeLineExit(); ple.setPath("success"); ple.setState("success"); pl.registerPipeLineExit(ple); adapter.registerPipeLine(pl); adapter.setConfiguration(configuration); configuration.registerAdapter(adapter); assertEquals(1, configuration.getConfigurationWarnings().size()); assertEquals("WsdlXmlValidator [dummy] attribute [schemaLocation] for wsdl [/Validation/Wsdl/GetPolicyDetails/GetPolicyDetails.wsdl] already has a default value [http: ConfigurationWarnings.getInstance().setActiveConfiguration(null); }
@Test public void warnUseSoapBodyNameSpace() throws IOException, PipeRunException, SAXException, WSDLException, ConfigurationException, XmlValidatorException { IbisManager ibisManager = spy(new DefaultIbisManager()); ibisManager.setIbisContext(spy(new IbisContext())); Configuration configuration = new Configuration(new DummyAdapterService()); configuration.setName("dummyConfiguration"); configuration.setVersion("1"); configuration.setIbisManager(ibisManager); ConfigurationWarnings.getInstance().setActiveConfiguration(configuration); IAdapter adapter = spy(new Adapter()); adapter.setName("dummy"); PipeLine pl = new PipeLine(); pl.setFirstPipe("dummy"); WsdlXmlValidator val = new WsdlXmlValidator(); val.setName("dummy"); val.setWsdl(BASIC); val.setSoapHeader("MessageHeader"); val.setSoapBody("GetPolicyDetails_Request"); val.setAddNamespaceToSchema(true); val.setSchemaLocation("http: val.setThrowException(true); val.registerForward(new PipeForward("success", null)); pl.addPipe(val); PipeLineExit ple = new PipeLineExit(); ple.setPath("success"); ple.setState("success"); pl.registerPipeLineExit(ple); adapter.registerPipeLine(pl); adapter.setConfiguration(configuration); configuration.registerAdapter(adapter); assertEquals(1, configuration.getConfigurationWarnings().size()); assertEquals("WsdlXmlValidator [dummy] use attribute [soapBodyNamespace] instead of attribute [schemaLocation] with value [http: ConfigurationWarnings.getInstance().setActiveConfiguration(null); }