You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/09/24 09:38:48 UTC
svn commit: r698450 -
/webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java
Author: nandana
Date: Wed Sep 24 00:38:47 2008
New Revision: 698450
URL: http://svn.apache.org/viewvc?rev=698450&view=rev
Log:
AXIS2-4046 process the wsp:Optional attribute
Modified:
webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java
Modified: webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java?rev=698450&r1=698449&r2=698450&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/mtompolicy/src/org/apache/axis2/policy/builders/MTOMAssertionBuilder.java Wed Sep 24 00:38:47 2008
@@ -20,12 +20,19 @@
package org.apache.axis2.policy.builders;
+import java.util.Iterator;
+import java.util.List;
+
import org.apache.axiom.om.OMElement;
import org.apache.axis2.policy.model.MTOMAssertion;
+import org.apache.axis2.util.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.neethi.Assertion;
import org.apache.neethi.AssertionBuilderFactory;
+import org.apache.neethi.Constants;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyEngine;
import org.apache.neethi.builders.AssertionBuilder;
import javax.xml.namespace.QName;
@@ -37,7 +44,11 @@
public Assertion build(OMElement element, AssertionBuilderFactory factory)
throws IllegalArgumentException {
+
MTOMAssertion mtomAssertion = new MTOMAssertion();
+
+ processMTOMAssertion(element, mtomAssertion);
+
return mtomAssertion;
}
@@ -45,6 +56,16 @@
return new QName[] {
new QName(MTOMAssertion.NS, MTOMAssertion.MTOM_SERIALIZATION_CONFIG_LN) };
}
+
+ private void processMTOMAssertion(OMElement element, MTOMAssertion mtomAssertion) {
+
+ //Checking wsp:Optional attribute
+ String value = element.getAttributeValue(Constants.Q_ELEM_OPTIONAL_ATTR);
+ boolean isOptional = JavaUtils.isTrueExplicitly(value);
+
+ mtomAssertion.setOptional(isOptional);
+
+ }
}