Author: alessio.soldano(a)jboss.com
Date: 2009-01-15 12:41:17 -0500 (Thu, 15 Jan 2009)
New Revision: 9053
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
Log:
[JBWS-2454] Setting javax.xml.ws.reference.parameters property in the message context
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2009-01-15
16:32:26 UTC (rev 9052)
+++
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2009-01-15
17:41:17 UTC (rev 9053)
@@ -27,6 +27,7 @@
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
@@ -43,6 +44,8 @@
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
/**
@@ -131,6 +134,8 @@
msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES,
Scope.APPLICATION);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
Scope.APPLICATION);
+ msgContext.put(MessageContext.REFERENCE_PARAMETERS,
convertToElementList(addrProps.getReferenceParameters().getElements()));
+ msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
}
}
catch (SOAPException ex)
@@ -140,4 +145,18 @@
return true;
}
+
+ private static List<Element> convertToElementList(List<Object> objects)
+ {
+ if (objects == null) return null;
+ List<Element> elements = new LinkedList<Element>();
+ for (Object o : objects)
+ {
+ if (o instanceof Element)
+ {
+ elements.add((Element)o);
+ }
+ }
+ return elements;
+ }
}
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
---
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2009-01-15
16:32:26 UTC (rev 9052)
+++
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2009-01-15
17:41:17 UTC (rev 9053)
@@ -27,6 +27,7 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
@@ -40,6 +41,8 @@
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
/**
@@ -82,9 +85,24 @@
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND,
Scope.APPLICATION);
-
+ msgContext.put(MessageContext.REFERENCE_PARAMETERS,
convertToElementList(addrProps.getReferenceParameters().getElements()));
+ msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
return true;
}
+
+ private static List<Element> convertToElementList(List<Object> objects)
+ {
+ if (objects == null) return null;
+ List<Element> elements = new LinkedList<Element>();
+ for (Object o : objects)
+ {
+ if (o instanceof Element)
+ {
+ elements.add((Element)o);
+ }
+ }
+ return elements;
+ }
protected boolean handleOutbound(MessageContext msgContext)
{
Show replies by date