}
@SuppressWarnings("unchecked")
private EndpointReferenceType toEndPointReference(Element root) {
EndpointReferenceType epr = null;
if (root != null) {
try {
JAXBContext jc = JaxbContextHandler.getAddressingContext();
JAXBElement<EndpointReferenceType> eprElem =
(JAXBElement<EndpointReferenceType>) jc.createUnmarshaller().unmarshal(root);
epr = eprElem.getValue();
} catch (JAXBException e) {
if (LOG.isLoggable(Level.SEVERE)) {
LOG.log(Level.SEVERE,
"Failed to deserialize endpoint reference", e);
}
}
} else {
LOG.log(Level.SEVERE, "No endpoint reference found in content");
}
return epr != null ? epr : new EndpointReferenceType();
}