ex.printStackTrace();
}
}
public DOMSource invoke(DOMSource request) {
DOMSource response = new DOMSource();
try {
SOAPMessage msg = factory.createMessage();
msg.getSOAPPart().setContent(request);
SOAPBody body = msg.getSOAPBody();
Node n = body.getFirstChild();
while (n.getNodeType() != Node.ELEMENT_NODE) {
n = n.getNextSibling();
}
if (n.getLocalName().equals(sayHi.getLocalPart())) {
response.setNode(sayHiResponse.getSOAPPart());
} else if (n.getLocalName().equals(greetMe.getLocalPart())) {
response.setNode(greetMeResponse.getSOAPPart());
}
} catch (Exception ex) {
ex.printStackTrace();
}
return response;