我这里只提供源代码,由于时间问题,不做分析,请谅解
public NotifySOAPHeader getNotifySOAPHeader() {
MessageContext msgContext = MessageContext.getCurrentMessageContext();
Iterator list = msgContext.getEnvelope().getHeader().getFirstElement().getChildren();
String spId = null;
String linkId = null;
String spRevId = null;
String spRevpassword = null;
String SAN = null;
while (list.hasNext()) {
OMElement element = (OMElement) list.next();
if (element.getLocalName().equals("linkId")) {
linkId = element.getText();
}
if(element.getLocalName().equals("spId")) {
spId=element.getText();
}
if(element.getLocalName().equals("spRevId")) {
spRevId=element.getText();
}
if(element.getLocalName().equals("spRevpassword")) {
spRevpassword=element.getText();
}
if(element.getLocalName().equals("SAN")) {
SAN=element.getText();
}
}
NotifySOAPHeader notifySOAPHeader = new NotifySOAPHeader();
notifySOAPHeader.setLinkId(linkId);
notifySOAPHeader.setSpId(spId);
notifySOAPHeader.setSpRevId(spRevId);
notifySOAPHeader.setSpRevpassword(spRevpassword);
notifySOAPHeader.setSAN(SAN);
return notifySOAPHeader;
}
NotifySOAPHeader notifySOAPHeader =sOAPHeaderProcess.getNotifySOAPHeader();
String linkId=notifySOAPHeader.getLinkId();