* @exception SOAPFaultException if decoded MAPs are invalid
*/
public AddressingProperties unmarshalMAPs(SoapMessage message) {
// REVISIT generate MessageAddressingHeaderRequired fault if an
// expected header is missing
AddressingPropertiesImpl maps = null;
try {
List<Header> header = message.getHeaders();
if (header != null) {
LOG.log(Level.FINE, "Inbound WS-Addressing headers");
Unmarshaller unmarshaller = null;
Set<Element> referenceParameterHeaders = null;
Iterator<Header> iter = header.iterator();
while (iter.hasNext()) {
Header hdr = iter.next();
if (hdr.getObject() instanceof Element) {
Element headerElement = (Element)hdr.getObject();
String headerURI = headerElement.getNamespaceURI();
// Need to check the uri before getting unmarshaller else
// would get wrong unmarshaller and fail to process required
// headers.
if (transformer.isSupported(headerURI)) {
if (unmarshaller == null) {
JAXBContext jaxbContext =
VersionTransformer.getExposedJAXBContext(headerURI);
unmarshaller =
jaxbContext.createUnmarshaller();
}
if (maps == null) {
maps = new AddressingPropertiesImpl();
maps.exposeAs(headerURI);
}
String localName = headerElement.getLocalName();
if (Names.WSA_MESSAGEID_NAME.equals(localName)) {
maps.setMessageID(decodeAsNative(
headerURI,
AttributedURIType.class,
headerElement,
unmarshaller));
} else if (Names.WSA_TO_NAME.equals(localName)) {
AttributedURIType addr = decodeAsNative(
headerURI,
AttributedURIType.class,
headerElement,
unmarshaller);
maps.setTo(EndpointReferenceUtils.getEndpointReference(addr));
} else if (Names.WSA_FROM_NAME.equals(localName)) {
maps.setFrom(decodeAsNative(
headerURI,
EndpointReferenceType.class,
headerElement,
unmarshaller));
} else if (Names.WSA_REPLYTO_NAME.equals(localName)) {
maps.setReplyTo(decodeAsNative(
headerURI,
EndpointReferenceType.class,
headerElement,
unmarshaller));
} else if (Names.WSA_FAULTTO_NAME.equals(localName)) {
maps.setFaultTo(decodeAsNative(
headerURI,
EndpointReferenceType.class,
headerElement,
unmarshaller));
} else if (Names.WSA_RELATESTO_NAME.equals(localName)) {
maps.setRelatesTo(decodeAsNative(
headerURI,
RelatesToType.class,
headerElement,
unmarshaller));
} else if (Names.WSA_ACTION_NAME.equals(localName)) {
maps.setAction(decodeAsNative(
headerURI,
AttributedURIType.class,
headerElement,
unmarshaller));
}