Author: thomas.diesler(a)jboss.com
Date: 2007-03-20 10:12:42 -0400 (Tue, 20 Mar 2007)
New Revision: 2648
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Unbind message again after LogicalHandler.setSource()
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-03-20
12:59:55 UTC (rev 2647)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-03-20
14:12:42 UTC (rev 2648)
@@ -93,7 +93,6 @@
public void setPayload(Source source)
{
- soapBody.setPayload(source);
if (setPayloadBodyChild)
{
try
@@ -116,6 +115,13 @@
throw new WebServiceException("Cannot set xml payload", ex);
}
}
+ else
+ {
+ soapBody.setPayload(source);
+ }
+
+ // The body payload has been modified
+ soapBody.setModifiedFromSource(true);
}
public Object getPayload(JAXBContext jaxbContext)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-20
12:59:55 UTC (rev 2647)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-20
14:12:42 UTC (rev 2648)
@@ -193,7 +193,8 @@
if (handlersPass)
{
// Check if protocol handlers modified the payload
- if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
+ if (soapBody.isModifiedFromSource())
{
log.debug("Handler modified body payload, unbind message
again");
epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-20
12:59:55 UTC (rev 2647)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-20
14:12:42 UTC (rev 2648)
@@ -32,7 +32,6 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -132,7 +131,7 @@
// Add the body elements
Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS,
"Body"));
- SOAPBody soapBody = soapEnv.getBody();
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
DOMUtils.copyAttributes(soapBody, domBody);
@@ -214,8 +213,10 @@
return soapEnv;
}
- public void buildBodyElementDoc(SOAPBody soapBody, Element domBodyElement) throws
SOAPException
+ public void buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws
SOAPException
{
+ soapBody.removeContents();
+
Element srcElement = (Element)domBodyElement;
registerNamespacesLocally(srcElement);
@@ -229,8 +230,10 @@
destElement.setXMLFragment(xmlFragment);
}
- public void buildBodyElementRpc(SOAPBody soapBody, Element domBodyElement) throws
SOAPException
+ public void buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws
SOAPException
{
+ soapBody.removeContents();
+
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
soapBodyElement = (SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-20
12:59:55 UTC (rev 2647)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-20
14:12:42 UTC (rev 2648)
@@ -86,6 +86,11 @@
{
return isModifiedFromSource;
}
+
+ public void setModifiedFromSource(boolean isModified)
+ {
+ this.isModifiedFromSource = isModified;
+ }
public Source getPayload()
{
Show replies by date