dims 2003/02/07 10:01:20
Modified: java/src/org/apache/axis/message MessageElement.java
SOAPBody.java
java/src/org/apache/axis/i18n resource.properties
Log:
Fix(es) for 8 SAAJ TCK failures.
Revision Changes Path
1.143 +6 -0 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -r1.142 -r1.143
--- MessageElement.java 16 Jan 2003 23:47:28 -0000 1.142
+++ MessageElement.java 7 Feb 2003 18:01:20 -0000 1.143
@@ -392,6 +392,12 @@
addMapping(enc11Mapping);
} else if (encodingStyle.equals(Constants.URI_SOAP12_ENC)) {
addMapping(enc12Mapping);
+ } else if (encodingStyle.equals(Constants.URI_SOAP12_NOENC)) {
+ // Do nothing.
+ } else if(encodingStyle.length() == 0){
+ // Do nothing.
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage("badEncodingStyle"));
}
}
1.39 +18 -14 xml-axis/java/src/org/apache/axis/message/SOAPBody.java
Index: SOAPBody.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBody.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- SOAPBody.java 12 Dec 2002 12:47:54 -0000 1.38
+++ SOAPBody.java 7 Feb 2003 18:01:20 -0000 1.39
@@ -64,6 +64,7 @@
import org.apache.axis.utils.Messages;
import org.apache.commons.logging.Log;
import org.xml.sax.Attributes;
+import org.w3c.dom.Element;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
@@ -233,26 +234,30 @@
}
public javax.xml.soap.SOAPFault addFault() throws SOAPException {
- SOAPFault fault = new SOAPFault(new AxisFault());
+
+ AxisFault af = new AxisFault(new QName(Constants.NS_URI_AXIS,
Constants.FAULT_SERVER_GENERAL), "", "", new Element[0]);
+ SOAPFault fault = new SOAPFault(af);
addBodyElement(fault);
return fault;
}
public javax.xml.soap.SOAPFault getFault() {
- try {
- return
(javax.xml.soap.SOAPFault)getBodyByName(Constants.URI_SOAP11_ENV,
Constants.ELEM_FAULT);
- } catch(AxisFault af){
- log.fatal(Messages.getMessage("exception00"), af);
- return null;
+ Enumeration e = bodyElements.elements();
+ while (e.hasMoreElements()) {
+ Object element = e.nextElement();
+ if(element instanceof javax.xml.soap.SOAPFault) {
+ return (javax.xml.soap.SOAPFault) element;
+ }
}
+ return null;
}
public boolean hasFault() {
- try {
- if(getBodyByName(Constants.URI_SOAP11_ENV, Constants.ELEM_FAULT)!=null)
+ Enumeration e = bodyElements.elements();
+ while (e.hasMoreElements()) {
+ if(e.nextElement() instanceof javax.xml.soap.SOAPFault) {
return true;
- } catch(AxisFault af){
- log.fatal(Messages.getMessage("exception00"), af);
+ }
}
return false;
}
@@ -268,11 +273,10 @@
public java.util.Iterator getChildElements(Name name) {
Vector v = new Vector();
Enumeration e = bodyElements.elements();
- SOAPBodyElement bodyEl;
+ SOAPElement bodyEl;
while (e.hasMoreElements()) {
- bodyEl = (SOAPBodyElement)e.nextElement();
- if (bodyEl.getNamespaceURI().equals(name.getURI()) &&
- bodyEl.getName().equals(name.getLocalName())) {
+ bodyEl = (SOAPElement)e.nextElement();
+ if (bodyEl.getElementName().equals(name)) {
v.addElement(bodyEl);
}
}
1.49 +1 -0 xml-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- resource.properties 6 Feb 2003 03:46:03 -0000 1.48
+++ resource.properties 7 Feb 2003 18:01:20 -0000 1.49
@@ -1133,3 +1133,4 @@
couldNotReadFromCharStream=Could not read from character stream
errorGetDocFromSOAPEnvelope=Could not get document from SOAPEnvelope
badEjbHomeType=The home object retrieved from jndi does not have the same type as
the one specified in the config file
+badEncodingStyle=Unknown encoding style
\ No newline at end of file