Author: veithen
Date: Sat May 30 22:52:15 2015
New Revision: 1682663
URL: http://svn.apache.org/r1682663
Log:
Non whitespace character data is not allowed in SOAP fault details. Only return
OMElement children.
Modified:
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFaultDetailSupport.aj
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
Modified:
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFaultDetailSupport.aj
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFaultDetailSupport.aj?rev=1682663&r1=1682662&r2=1682663&view=diff
==============================================================================
---
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFaultDetailSupport.aj
(original)
+++
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFaultDetailSupport.aj
Sat May 30 22:52:15 2015
@@ -28,6 +28,6 @@ public aspect AxiomSOAPFaultDetailSuppor
}
public final Iterator AxiomSOAPFaultDetail.getAllDetailEntries() {
- return getChildren();
+ return getChildElements();
}
}
Modified:
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml?rev=1682663&r1=1682662&r2=1682663&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml
(original)
+++
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap11/message.xml
Sat May 30 22:52:15 2015
@@ -49,7 +49,6 @@
http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver
</faultactor>
<detail xmlns:m="http://www.sample.org">
- Details of error
<m:MaxTime m:detail="This is only a test">
P5M
</m:MaxTime>
Modified:
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml?rev=1682663&r1=1682662&r2=1682663&view=diff
==============================================================================
---
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
(original)
+++
webservices/axiom/trunk/axiom-api/src/test/resources/soap/soap12/message.xml
Sat May 30 22:52:15 2015
@@ -62,7 +62,6 @@
ultimateReceiver
</env:Role>
<env:Detail>
- Details of error
<m:MaxTime m:detail="This is only a test">
P5M\n
</m:MaxTime>
Modified:
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java?rev=1682663&r1=1682662&r2=1682663&view=diff
==============================================================================
---
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
(original)
+++
webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/faultdetail/TestGetAllDetailEntriesWithParser.java
Sat May 30 22:52:15 2015
@@ -22,8 +22,9 @@ import java.util.Iterator;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMText;
import org.apache.axiom.soap.SOAPFaultDetail;
+import org.apache.axiom.ts.soap.SOAPSampleAdapter;
+import org.apache.axiom.ts.soap.SOAPSampleSet;
import org.apache.axiom.ts.soap.SOAPSpec;
import org.apache.axiom.ts.soap.SOAPTestCase;
@@ -34,31 +35,22 @@ public class TestGetAllDetailEntriesWith
}
protected void runTest() throws Throwable {
- SOAPFaultDetail soapFaultDetail =
getTestMessage(MESSAGE).getBody().getFault().getDetail();
+ SOAPFaultDetail soapFaultDetail =
SOAPSampleSet.SIMPLE_FAULT.getMessage(spec).getAdapter(SOAPSampleAdapter.class).getSOAPEnvelope(metaFactory).getBody().getFault().getDetail();
Iterator iterator = soapFaultDetail.getAllDetailEntries();
- OMText textEntry = (OMText) iterator.next();
- assertNotNull(
- "SOAP Fault Detail Test With Parser : - getAllDetailEntries
method returns empty iterator",
- textEntry);
- assertEquals(
- "SOAP Fault Detail Test With Parser : - text value mismatch",
- "Details of error", textEntry.getText().trim());
OMElement detailEntry1 = (OMElement) iterator.next();
assertNotNull(
"SOAP Fault Detail Test With Parser : - getAllDetailEntries
method returns an itrator without detail entries",
detailEntry1);
assertEquals(
"SOAP Fault Detail Test With Parser : - detailEntry1 localname
mismatch",
- "MaxTime", detailEntry1.getLocalName());
- iterator.next();
+ "ErrorCode", detailEntry1.getLocalName());
OMElement detailEntry2 = (OMElement) iterator.next();
assertNotNull(
"SOAP Fault Detail Test With Parser : - getAllDetailEntries
method returns an itrator with only one detail entries",
detailEntry2);
assertEquals(
"SOAP Fault Detail Test With Parser : - detailEntry2 localname
mismatch",
- "AveTime", detailEntry2.getLocalName());
- iterator.next();
+ "Message", detailEntry2.getLocalName());
assertFalse(
"SOAP Fault Detail Test With Parser : - getAllDetailEntries
method returns an itrator with more than two detail entries",
iterator.hasNext());