use of org.apache.cxf.staxutils.XMLStreamReaderWrapper in project cxf by apache.
the class WSDLManagerImplTest method testXMLStreamReaderWrapper.
@Test
public void testXMLStreamReaderWrapper() throws Exception {
final Map<String, String> map = new HashMap<>();
map.put("org.apache.cxf.test.wsdl11.port", "99999");
String wsdlUrl = getClass().getResource("hello_world_wrap.wsdl").toString();
WSDLManagerImpl builder = new WSDLManagerImpl();
builder.setXMLStreamReaderWrapper(new XMLStreamReaderWrapper() {
@Override
public XMLStreamReader wrap(XMLStreamReader reader) {
return new PropertiesExpandingStreamReader(reader, map);
}
});
Definition def = builder.getDefinition(wsdlUrl);
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
builder.getWSDLFactory().newWSDLWriter().writeWSDL(def, bos);
assertTrue(bos.toString().contains("http://localhost:99999/SoapContext/SoapPort"));
}
Aggregations