Author: ropalka
Date: 2011-12-06 05:18:33 -0500 (Tue, 06 Dec 2011)
New Revision: 15351
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
Log:
removing obsolete 'org.jboss.ws.allow.expand.dom' property
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -54,10 +54,6 @@
private static final ResourceBundle bundle =
BundleUtils.getBundle(CommonMessageContext.class);
private static Logger log = Logger.getLogger(CommonMessageContext.class);
- // expandToDOM in the SOAPContentElement should not happen during normal operation
- // This property should be set the message context when it is ok to do so.
- public static final String ALLOW_EXPAND_TO_DOM =
"org.jboss.ws.allow.expand.dom";
-
public static final String REMOTING_METADATA =
"org.jboss.ws.remoting.metadata";
// The serialization context for this message ctx
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -880,25 +880,16 @@
if (SOAP_ARRAY_NAME.equals(elName))
{
- CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
+ QName compXMLName = paramMetaData.getXmlName();
+ Element compElement = DOMUtils.getFirstChildElement(aux);
+ // NPE when the soap encoded array size is 0 on the return path
+ //
http://jira.jboss.org/jira/browse/JBWS-1285
+ if (compElement == null ||
compElement.getNodeName().equals(compXMLName.getLocalPart()))
{
- QName compXMLName = paramMetaData.getXmlName();
- Element compElement = DOMUtils.getFirstChildElement(aux);
- // NPE when the soap encoded array size is 0 on the return path
- //
http://jira.jboss.org/jira/browse/JBWS-1285
- if (compElement == null ||
compElement.getNodeName().equals(compXMLName.getLocalPart()))
- {
- soapContentElement = aux;
- soapContentElement.setParamMetaData(paramMetaData);
- break;
- }
+ soapContentElement = aux;
+ soapContentElement.setParamMetaData(paramMetaData);
+ break;
}
- finally
- {
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- }
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -274,8 +274,6 @@
log.debug("Enter: handleRequest");
SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
// Replace handlers that did not survive the previous call
replaceDirtyHandlers();
@@ -318,8 +316,6 @@
// we start at this index in the response chain
if (doNext == false)
falseIndex = (handlerIndex - 1);
-
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handleRequest with status: " + doNext);
}
}
@@ -356,7 +352,6 @@
log.debug("Enter: handleResponse");
SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
int handlerIndex = handlers.size() - 1;
if (falseIndex != -1)
@@ -401,7 +396,6 @@
if (doNext == false)
falseIndex = (handlerIndex - 1);
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
log.debug("Exit: handleResponse with status: " + doNext);
}
}
@@ -435,35 +429,21 @@
if (handlers.size() > 0)
{
- log.debug("Enter: handleFault");
+ int handlerIndex = handlers.size() - 1;
+ if (falseIndex != -1)
+ handlerIndex = falseIndex;
- SOAPMessageContextJAXRPC jaxrpcContext = (SOAPMessageContextJAXRPC)msgContext;
- jaxrpcContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM,
Boolean.TRUE);
-
- try
+ Handler currHandler = null;
+ for (; doNext && handlerIndex >= 0; handlerIndex--)
{
- int handlerIndex = handlers.size() - 1;
- if (falseIndex != -1)
- handlerIndex = falseIndex;
-
- Handler currHandler = null;
- for (; doNext && handlerIndex >= 0; handlerIndex--)
+ HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
+ if (type == HandlerType.ALL || type == handlerEntry.getType())
{
- HandlerEntry handlerEntry = (HandlerEntry)handlers.get(handlerIndex);
- if (type == HandlerType.ALL || type == handlerEntry.getType())
- {
- currHandler = handlerEntry.getHandler();
-
- log.debug("Handle fault: " + currHandler);
- doNext = currHandler.handleFault(msgContext);
- }
+ currHandler = handlerEntry.getHandler();
+ log.debug("Handle fault: " + currHandler);
+ doNext = currHandler.handleFault(msgContext);
}
}
- finally
- {
- jaxrpcContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- log.debug("Exit: handleFault with status: " + doNext);
- }
}
return doNext;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -326,14 +326,12 @@
try
{
- context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
context.setCurrentScope(Scope.HANDLER);
return currHandler.handleMessage(msgContext);
}
finally
{
context.setCurrentScope(Scope.APPLICATION);
- context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
}
}
@@ -351,14 +349,12 @@
try
{
- context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
context.setCurrentScope(Scope.HANDLER);
return currHandler.handleFault(msgContext);
}
finally
{
context.setCurrentScope(Scope.APPLICATION);
- context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -208,54 +208,46 @@
if (handlersPass)
{
- msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
- try
+ // Check if protocol handlers modified the payload
+ if (msgContext.isModified())
{
- // Check if protocol handlers modified the payload
- if (msgContext.isModified())
+ log.debug("Handler modified payload, unbind message again");
+ reqMessage = msgContext.getMessageAbstraction();
+ sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+ //JBWS-2969:check if the RPC/Lit input paramter is null
+ if (opMetaData.getEndpointMetaData().getType() !=
EndpointMetaData.Type.JAXRPC
+ && opMetaData.isRPCLiteral() &&
sepInv.getRequestParamNames() != null)
+ {
+
+ for (QName qname : sepInv.getRequestParamNames())
{
- log.debug("Handler modified payload, unbind message again");
- reqMessage = msgContext.getMessageAbstraction();
- sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
- //JBWS-2969:check if the RPC/Lit input paramter is null
- if (opMetaData.getEndpointMetaData().getType() !=
EndpointMetaData.Type.JAXRPC
- && opMetaData.isRPCLiteral() &&
sepInv.getRequestParamNames() != null)
- {
-
- for (QName qname : sepInv.getRequestParamNames())
+ ParameterMetaData paramMetaData = opMetaData.getParameter(qname);
+ if ((paramMetaData.getMode().equals(ParameterMode.IN) ||
paramMetaData.getMode().equals(ParameterMode.INOUT)) &&
sepInv.getRequestParamValue(qname) == null)
{
- ParameterMetaData paramMetaData = opMetaData.getParameter(qname);
- if ((paramMetaData.getMode().equals(ParameterMode.IN) ||
paramMetaData.getMode().equals(ParameterMode.INOUT)) &&
sepInv.getRequestParamValue(qname) == null)
- {
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"RPC/LITERAL_PAPAMETERS_IS_NULL", opMetaData.getQName()));
- }
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"RPC/LITERAL_PAPAMETERS_IS_NULL", opMetaData.getQName()));
}
}
+ }
- // Invoke an instance of the SEI implementation bean
- Invocation inv = setupInvocation(endpoint, sepInv, invContext);
- InvocationHandler invHandler = endpoint.getInvocationHandler();
-
- try
- {
- invHandler.invoke(endpoint, inv);
- }
- catch (InvocationTargetException th)
- {
- //Unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = th.getTargetException();
- throw (targetEx instanceof Exception ? (Exception)targetEx : new
UndeclaredThrowableException(targetEx));
- }
+ // Invoke an instance of the SEI implementation bean
+ Invocation inv = setupInvocation(endpoint, sepInv, invContext);
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
- // Handler processing might have replaced the endpoint invocation
- sepInv =
inv.getInvocationContext().getAttachment(EndpointInvocation.class);
+ try
+ {
+ invHandler.invoke(endpoint, inv);
}
- finally
+ catch (InvocationTargetException th)
{
- msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+ //Unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = th.getTargetException();
+ throw (targetEx instanceof Exception ? (Exception)targetEx : new
UndeclaredThrowableException(targetEx));
}
+ // Handler processing might have replaced the endpoint invocation
+ sepInv = inv.getInvocationContext().getAttachment(EndpointInvocation.class);
+
// Reverse the message direction
msgContext = processPivotInternal(msgContext, direction);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2011-12-05
17:19:02 UTC (rev 15350)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2011-12-06
10:18:33 UTC (rev 15351)
@@ -621,13 +621,6 @@
// 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.put(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())