Author: thomas.diesler(a)jboss.com
Date: 2007-03-27 13:06:43 -0400 (Tue, 27 Mar 2007)
New Revision: 2694
Modified:
branches/jbossws-1.2.1/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
Log:
Remove id elements at the end of href inlining
Modified:
branches/jbossws-1.2.1/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java
===================================================================
---
branches/jbossws-1.2.1/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-03-27
16:45:04 UTC (rev 2693)
+++
branches/jbossws-1.2.1/jbossws-core/src/java/org/jboss/ws/core/soap/HRefInlineHandler.java 2007-03-27
17:06:43 UTC (rev 2694)
@@ -27,6 +27,7 @@
import javax.xml.soap.Node;
import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
@@ -54,15 +55,26 @@
public void processHRefs() throws SOAPException
{
- SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
-
String bodyStr = DOMWriter.printNode(soapBody, true);
- log.info("Begin processHRefs:\n" + bodyStr);
+ log.debug("Begin processHRefs:\n" + bodyStr);
- processElement(soapElement);
+ Iterator it = soapBody.getChildElements();
+ while (it.hasNext())
+ {
+ // Process the first body element, remove the others
+ SOAPElement soapElement = (SOAPElement)it.next();
+ if (soapElement instanceof SOAPBodyElement)
+ {
+ processElement(soapElement);
+ }
+ else
+ {
+ soapBody.removeChild(soapElement);
+ }
+ }
bodyStr = DOMWriter.printNode(soapBody, true);
- log.info("End processHRefs:\n" + bodyStr);
+ log.debug("End processHRefs:\n" + bodyStr);
}
private void processElement(SOAPElement soapElement) throws SOAPException
@@ -125,8 +137,5 @@
String value = idElement.getValue();
hrefElement.setValue(value);
}
-
- // Remove id element
- soapBody.removeChild(idElement);
}
}
Show replies by date