Author: thomas.diesler(a)jboss.com
Date: 2007-03-15 09:41:38 -0400 (Thu, 15 Mar 2007)
New Revision: 2622
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
Log:
Use application scoped properties
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-15
13:14:00 UTC (rev 2621)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-03-15
13:41:38 UTC (rev 2622)
@@ -32,9 +32,11 @@
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
@@ -571,8 +573,13 @@
// See SOAPFactoryImpl for details.
log.debug("MTOM disabled: Force inline XOP data");
+
+ // TODO: This property must be reset, otherwise you negate its purpose
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+ if (msgContext instanceof MessageContextJAXWS)
+
((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Scope.APPLICATION);
+
expandToDOM();
}
else if ( domContentState && XOPContext.isMTOMEnabled() )
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-03-15
13:14:00 UTC (rev 2621)
+++
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2007-03-15
13:41:38 UTC (rev 2622)
@@ -29,6 +29,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
@@ -76,6 +77,7 @@
// supply default addressing properties
addrProps =
(SOAPAddressingPropertiesImpl)addrBuilder.newAddressingProperties();
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
addrProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
Scope.APPLICATION);
if (normalize)
normalizeRequest(msgContext, addrProps);
@@ -97,6 +99,7 @@
SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)builder.newAddressingProperties();
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
addrProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND,
Scope.APPLICATION);
}
}
catch (SOAPException ex)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2007-03-15
13:14:00 UTC (rev 2621)
+++
trunk/jbossws-core/src/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2007-03-15
13:41:38 UTC (rev 2622)
@@ -29,6 +29,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
@@ -69,6 +70,7 @@
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND,
Scope.APPLICATION);
if (validate)
validateRequest(addrProps);
@@ -107,6 +109,7 @@
// create new response properties
outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
outProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
Scope.APPLICATION);
}
outProps.initializeAsReply(inProps, isFault);
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2007-03-15
13:14:00 UTC (rev 2621)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ClientHandler.java 2007-03-15
13:41:38 UTC (rev 2622)
@@ -33,6 +33,7 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
@@ -84,6 +85,7 @@
refParams.addElement(getClientIdElement(clientid));
msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
outProps);
+ msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
Scope.APPLICATION);
}
catch (URISyntaxException ex)
{
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-03-15
13:14:00 UTC (rev 2621)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wsaddressing/ServerHandler.java 2007-03-15
13:41:38 UTC (rev 2622)
@@ -31,6 +31,7 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
@@ -79,6 +80,7 @@
// put the clientid in the message context
msgContext.put("clientid", clientid);
+ msgContext.setScope("clientid", Scope.APPLICATION);
return true;
}
@@ -98,6 +100,7 @@
outProps.setAction(builder.newURI("http://org.jboss.ws/addressing/stateful/actionReply"));
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
outProps);
+ msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
Scope.APPLICATION);
}
catch (URISyntaxException ex)
{