XMLStreamReader domReader = StaxUtils.createXMLStreamReader(doc);
Map<String, String> inMap = new HashMap<String, String>();
inMap.put("{http://schemas.xmlsoap.org/ws/2005/04/discovery}*",
"{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}*");
InTransformReader reader = new InTransformReader(domReader, inMap , null, false);
doc = StaxUtils.read(reader);
mapToOld = true;
}
if (!"http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"
.equals(doc.getDocumentElement().getNamespaceURI())) {
//not a proper ws-discovery message, ignore it
return null;
}
Object obj = context.createUnmarshaller().unmarshal(doc.getDocumentElement());
if (obj instanceof JAXBElement) {
obj = ((JAXBElement)obj).getValue();
}
if (obj instanceof ProbeType) {
ProbeMatchesType pmt = handleProbe((ProbeType)obj);
if (pmt == null) {
return null;
}
if (mapToOld) {
doc.removeChild(doc.getDocumentElement());
DOMResult result = new DOMResult(doc);
XMLStreamWriter r = StaxUtils.createXMLStreamWriter(result);
context.createMarshaller().marshal(factory.createProbeMatches(pmt), r);
XMLStreamReader domReader = StaxUtils.createXMLStreamReader(doc);
Map<String, String> inMap = new HashMap<String, String>();
inMap.put("{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}*",
"{http://schemas.xmlsoap.org/ws/2005/04/discovery}*");
InTransformReader reader = new InTransformReader(domReader, inMap , null, false);
doc = StaxUtils.read(reader);
return new DOMSource(doc);
}
return new JAXBSource(context, factory.createProbeMatches(pmt));
} else if (obj instanceof HelloType) {