ex.printStackTrace();
}
}
public StreamSource invoke(StreamSource request) {
StreamSource response = new StreamSource();
try {
DOMResult domResult = new DOMResult();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(request, domResult);
Node n = domResult.getNode().getFirstChild();
while (n.getNodeType() != Node.ELEMENT_NODE) {
n = n.getNextSibling();
}
if (n.getLocalName().equals(sayHi.getLocalPart())) {
response.setInputStream(sayHiInputStream);
} else if (n.getLocalName().equals(greetMe.getLocalPart())) {
response.setInputStream(greetMeInputStream);
}
} catch (Exception ex) {
ex.printStackTrace();
}
return response;