You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/06/26 11:59:41 UTC
svn commit: r201831 [1/3] - in /webservices/axis/trunk/java/modules:
core/src/org/apache/axis/clientapi/ core/src/org/apache/axis/engine/
xml/src/org/apache/axis/om/impl/llom/ xml/src/org/apache/axis/soap/
xml/src/org/apache/axis/soap/impl/llom/ xml/sr...
Author: chinthaka
Date: Sun Jun 26 01:24:38 2005
New Revision: 201831
URL: http://svn.apache.org/viewcvs?rev=201831&view=rev
Log:
- Adding more test cases for SOAP 1.1 and 1.2
- fixed bugs in SOAP API
- fixed some bugs in OM
- fixed some stuff in core code
Added:
webservices/axis/trunk/java/modules/xml/test-resources/soap/invalidMustUnderstandSOAP12.xml
webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/
webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11fault.xml
webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11message.xml
webservices/axis/trunk/java/modules/xml/test-resources/soap/soap12message.xml
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPEnvelopeTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultDetailTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultNodeTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultReasonTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultRoleTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultSubCodeTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultTextTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultValueTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderBlockTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPHeaderTestCase.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPTestCase.java
Removed:
webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11fault.xml
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/SOAPHeaderBlock.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultSubCodeImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultTextImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP11BuilderHelper.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP12BuilderHelper.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11BodyImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderBlockImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultValueImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderBlockImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderImpl.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java
webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/impl/llom/soap11/SOAP11SerialiserTest.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java Sun Jun 26 01:24:38 2005
@@ -42,6 +42,7 @@
import org.apache.axis.engine.AxisFault;
import org.apache.axis.om.OMException;
import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.om.impl.llom.OMOutput;
import org.apache.axis.soap.SOAPEnvelope;
import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
import org.apache.axis.transport.TransportListener;
@@ -164,6 +165,7 @@
MessageContext response = TwoChannelBasedSender.send(msgctx, listenerTransport);
SOAPEnvelope resenvelope = response.getEnvelope();
+
if (resenvelope.getBody().hasFault()) {
throw new AxisFault(resenvelope.getBody().getFault().getException());
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Sun Jun 26 01:24:38 2005
@@ -21,6 +21,7 @@
import org.apache.axis.description.OperationDescription;
import org.apache.axis.description.TransportOutDescription;
import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.impl.llom.OMOutput;
import org.apache.axis.soap.SOAPBody;
import org.apache.axis.soap.SOAPEnvelope;
import org.apache.axis.soap.impl.llom.SOAPProcessingException;
@@ -28,6 +29,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.xml.stream.XMLStreamException;
import java.util.ArrayList;
/**
@@ -179,6 +181,7 @@
SOAPBody body = envelope.getBody();
e.printStackTrace();
body.addFault(new AxisFault(e.getMessage(), e));
+
faultContext.setEnvelope(envelope);
OperationContext opContext = context.getOperationContext();
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java Sun Jun 26 01:24:38 2005
@@ -627,7 +627,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
- private void serialize(OMOutput omOutput,boolean cache)throws XMLStreamException {
+ protected void serialize(OMOutput omOutput,boolean cache)throws XMLStreamException {
// select the builder
short builderType = PULL_TYPE_BUILDER; // default is pull type
@@ -782,10 +782,14 @@
* @return
*/
public QName getQName() {
- QName qName = null;
+ QName qName = null;
if (ns != null) {
- qName = new QName(ns.getName(), localName, ns.getPrefix());
+ if (ns.getPrefix() != null) {
+ qName = new QName(ns.getName(), localName, ns.getPrefix());
+ }else{
+ qName = new QName(ns.getName(), localName);
+ }
} else {
qName = new QName(localName);
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/SOAPHeaderBlock.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/SOAPHeaderBlock.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/SOAPHeaderBlock.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/SOAPHeaderBlock.java Sun Jun 26 01:24:38 2005
@@ -72,7 +72,7 @@
* <CODE>SOAPHeaderBlock</CODE> object is turned on;
* <CODE>false</CODE> otherwise
*/
- public abstract boolean getMustUnderstand();
+ public abstract boolean getMustUnderstand() throws SOAPProcessingException;
public abstract boolean isProcessed();
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java Sun Jun 26 01:24:38 2005
@@ -81,19 +81,21 @@
//check for the first element
OMElement element = getFirstElement();
- if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
- soapBody = (SOAPBody) element;
- } else { // if not second element SHOULD be the body
- OMNode node = element.getNextSibling();
- while (node.getType() != OMNode.ELEMENT_NODE) {
- node = node.getNextSibling();
- }
- element = (OMElement) node;
-
+ if (element != null) {
if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
soapBody = (SOAPBody) element;
- } else {
- throw new OMException("SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.");
+ } else { // if not second element SHOULD be the body
+ OMNode node = element.getNextSibling();
+ while (node != null && node.getType() != OMNode.ELEMENT_NODE) {
+ node = node.getNextSibling();
+ }
+ element = (OMElement) node;
+
+ if (node != null && SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+ soapBody = (SOAPBody) element;
+ } else {
+ throw new OMException("SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.");
+ }
}
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultSubCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultSubCodeImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultSubCodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultSubCodeImpl.java Sun Jun 26 01:24:38 2005
@@ -51,7 +51,7 @@
public SOAPFaultValue getValue() {
if (value == null) {
- value = (SOAPFaultValue) UtilProvider.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
+ value = (SOAPFaultValue) UtilProvider.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME);
}
return value;
}
@@ -63,7 +63,7 @@
public SOAPFaultSubCode getSubCode() {
if (subCode == null) {
- subCode = (SOAPFaultSubCode) UtilProvider.getChildWithName(this, SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME);
+ subCode = (SOAPFaultSubCode) UtilProvider.getChildWithName(this, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
}
return subCode;
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultTextImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultTextImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPFaultTextImpl.java Sun Jun 26 01:24:38 2005
@@ -1,8 +1,6 @@
package org.apache.axis.soap.impl.llom;
-import org.apache.axis.om.OMElement;
-import org.apache.axis.om.OMAttribute;
-import org.apache.axis.om.OMXMLParserWrapper;
+import org.apache.axis.om.*;
import org.apache.axis.om.impl.llom.OMElementImpl;
import org.apache.axis.om.impl.llom.OMAttributeImpl;
import org.apache.axis.soap.SOAPFaultText;
@@ -29,6 +27,7 @@
*/
public abstract class SOAPFaultTextImpl extends SOAPElement implements SOAPFaultText {
protected OMAttribute langAttr;
+ protected OMNamespace langNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
protected SOAPFaultTextImpl(SOAPFaultReason parent) throws SOAPProcessingException {
super(parent, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME, true);
@@ -40,15 +39,17 @@
public void setLang(String lang) {
- langAttr = new OMAttributeImpl(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, parent.getNamespace(), lang);
+ //langAttr = new OMAttributeImpl(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, parent.getNamespace(), lang);
+ langAttr = new OMAttributeImpl(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, langNamespace, lang);
this.addAttribute(langAttr);
}
public String getLang() {
if (langAttr == null) {
- langAttr = this.getFirstAttribute(new QName(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, parent.getNamespace().getName()));
+ //langAttr = this.getFirstAttribute(new QName(SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, parent.getNamespace().getName()));
+ langAttr = this.getFirstAttribute(new QName(langNamespace.getName(),SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX ));
}
- return langAttr.getValue();
+ return langAttr == null ? null : langAttr.getValue();
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java Sun Jun 26 01:24:38 2005
@@ -120,7 +120,22 @@
* <code>SOAPHeaderBlock</code> objects that contain the specified
* actor and are marked as MustUnderstand
*/
- public abstract Iterator examineMustUnderstandHeaderBlocks(String actor);
+ public Iterator examineMustUnderstandHeaderBlocks(String actor){
+ Iterator headerBlocksIter = this.getChildren();
+ ArrayList mustUnderstandHeadersWithGivenActor = new ArrayList();
+ while (headerBlocksIter.hasNext()) {
+ Object o = headerBlocksIter.next();
+ if (o instanceof SOAPHeaderBlock) {
+ SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) o;
+ String role = soapHeaderBlock.getRole();
+ boolean mustUnderstand = soapHeaderBlock.getMustUnderstand();
+ if ((role != null) && role.equalsIgnoreCase(actor) && mustUnderstand) {
+ mustUnderstandHeadersWithGivenActor.add(soapHeaderBlock);
+ }
+ }
+ }
+ return mustUnderstandHeadersWithGivenActor.iterator();
+ }
/**
* Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP11BuilderHelper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP11BuilderHelper.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP11BuilderHelper.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP11BuilderHelper.java Sun Jun 26 01:24:38 2005
@@ -94,7 +94,7 @@
processAttributes(element);
} else {
element = OMAbstractFactory.getOMFactory().createOMElement(localName, null, parent, builder);
- processNamespaceData(element, true);
+ processNamespaceData(element, false);
processAttributes(element);
}
@@ -108,13 +108,13 @@
throw new OMBuilderException("faultactor element should not have children");
} else {
element = OMAbstractFactory.getOMFactory().createOMElement(localName, null, parent, builder);
- processNamespaceData(element, true);
+ processNamespaceData(element, false);
processAttributes(element);
}
} else if (elementLevel > 5) {
element = OMAbstractFactory.getOMFactory().createOMElement(localName, null, parent, builder);
- processNamespaceData(element, true);
+ processNamespaceData(element, false);
processAttributes(element);
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP12BuilderHelper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP12BuilderHelper.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP12BuilderHelper.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/SOAP12BuilderHelper.java Sun Jun 26 01:24:38 2005
@@ -66,7 +66,7 @@
if (codePresent) {
throw new OMBuilderException("Multiple Code element encountered");
} else {
- element = factory.createSOAPFaultCode((SOAPFault) parent, null);
+ element = factory.createSOAPFaultCode((SOAPFault) parent, builder);
codePresent = true;
codeprocessing = true;
}
@@ -76,7 +76,7 @@
if (reasonPresent) {
throw new OMBuilderException("Multiple Reason Element encountered");
} else {
- element = factory.createSOAPFaultReason((SOAPFault) parent, null);
+ element = factory.createSOAPFaultReason((SOAPFault) parent, builder);
reasonPresent = true;
reasonProcessing = true;
}
@@ -97,7 +97,7 @@
if (nodePresent) {
throw new OMBuilderException("Multiple Node element encountered");
} else {
- element = factory.createSOAPFaultNode((SOAPFault) parent, null);
+ element = factory.createSOAPFaultNode((SOAPFault) parent, builder);
nodePresent = true;
}
} else {
@@ -112,7 +112,7 @@
if (rolePresent) {
throw new OMBuilderException("Multiple Role element encountered");
} else {
- element = factory.createSOAPFaultRole((SOAPFault) parent, null);
+ element = factory.createSOAPFaultRole((SOAPFault) parent, builder);
rolePresent = true;
}
} else {
@@ -127,7 +127,7 @@
if (detailPresent) {
throw new OMBuilderException("Multiple detail element encountered");
} else {
- element = factory.createSOAPFaultDetail((SOAPFault) parent, null);
+ element = factory.createSOAPFaultDetail((SOAPFault) parent, builder);
detailPresent = true;
}
} else {
@@ -144,7 +144,7 @@
if (parent.getLocalName().equals(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME)) {
if (parser.getLocalName().equals(SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME)) {
if (!valuePresent) {
- element = factory.createSOAPFaultValue((SOAPFaultCode) parent, null);
+ element = factory.createSOAPFaultValue((SOAPFaultCode) parent, builder);
valuePresent = true;
codeprocessing = false;
} else {
@@ -154,7 +154,7 @@
} else if (parser.getLocalName().equals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME)) {
if (!subcodePresent) {
if (valuePresent) {
- element = factory.createSOAPFaultSubCode((SOAPFaultCode) parent, null);
+ element = factory.createSOAPFaultSubCode((SOAPFaultCode) parent, builder);
subcodePresent = true;
subCodeProcessing = true;
} else {
@@ -170,7 +170,7 @@
} else if (parent.getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)) {
if (parser.getLocalName().equals(SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME)) {
- element = factory.createSOAPFaultText((SOAPFaultReason) parent, null);
+ element = factory.createSOAPFaultText((SOAPFaultReason) parent, builder);
element.setComplete(false);
reasonProcessing = false;
builder.setBooleanProcessingMandatoryFaultElements(false);
@@ -178,7 +178,7 @@
throw new OMBuilderException(parser.getLocalName() + " is not supported inside the reason");
}
} else if (parent.getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)) {
- element = OMAbstractFactory.getOMFactory().createOMElement(parser.getLocalName(), null, parent, null);
+ element = OMAbstractFactory.getOMFactory().createOMElement(parser.getLocalName(), null, parent, builder);
builder.setProcessingDetailElements(true);
detailElementNames = new Vector();
detailElementNames.add(parser.getLocalName());
@@ -194,7 +194,7 @@
if (subcodeValuePresent) {
throw new OMBuilderException("multiple subCode value encountered");
} else {
- element = factory.createSOAPFaultValue((SOAPFaultSubCode) parent, null);
+ element = factory.createSOAPFaultValue((SOAPFaultSubCode) parent, builder);
subcodeValuePresent = true;
subSubcodePresent = false;
subCodeProcessing = false;
@@ -202,7 +202,7 @@
} else if (parser.getLocalName().equals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME)) {
if (subcodeValuePresent) {
if (!subSubcodePresent) {
- element = factory.createSOAPFaultSubCode((SOAPFaultSubCode) parent, null);
+ element = factory.createSOAPFaultSubCode((SOAPFaultSubCode) parent, builder);
subcodeValuePresent = false;
subSubcodePresent = true;
subCodeProcessing = true;
@@ -226,7 +226,7 @@
}
if (localNameExist) {
detailElementNames.setSize(detailElementLevel);
- element = OMAbstractFactory.getOMFactory().createOMElement(parser.getLocalName(), null, parent, null);
+ element = OMAbstractFactory.getOMFactory().createOMElement(parser.getLocalName(), null, parent, builder);
detailElementNames.add(parser.getLocalName());
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11BodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11BodyImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11BodyImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11BodyImpl.java Sun Jun 26 01:24:38 2005
@@ -45,8 +45,7 @@
}
public SOAPFault addFault(Exception e) throws OMException {
- SOAPFault soapFault = new SOAP11FaultImpl(this, e);
- addFault(soapFault);
+ SOAPFault soapFault = new SOAP11Factory().createSOAPFault(this, e);
return soapFault;
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java Sun Jun 26 01:24:38 2005
@@ -3,10 +3,8 @@
import org.apache.axis.om.impl.llom.OMNamespaceImpl;
import org.apache.axis.om.OMXMLParserWrapper;
import org.apache.axis.om.OMNamespace;
-import org.apache.axis.om.OMElement;
import org.apache.axis.soap.*;
import org.apache.axis.soap.impl.llom.*;
-import org.apache.axis.soap.impl.llom.soap12.SOAP12HeaderImpl;
import org.apache.axis.soap.impl.llom.factory.SOAPLinkedListImplFactory;
/**
@@ -31,7 +29,7 @@
*/
public SOAPEnvelope createSOAPEnvelope() {
- return new SOAPEnvelopeImpl(new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX));
+ return new SOAPEnvelopeImpl(new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX));
}
public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) throws SOAPProcessingException {
@@ -157,15 +155,14 @@
public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
OMNamespace ns =
new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
- SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
+ SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns);
- SOAPHeaderImpl headerImpl = new SOAP11HeaderImpl(env);
- headerImpl.setComplete(true);
+ SOAPHeader headerImpl = createSOAPHeader(env);
+
+ SOAPBody bodyImpl = createSOAPBody(env);
- SOAPBodyImpl bodyImpl = new SOAP11BodyImpl(env);
- bodyImpl.setComplete(true);
return env;
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java Sun Jun 26 01:24:38 2005
@@ -74,7 +74,7 @@
}
}
- protected void serialize(OMOutput omOutput, boolean cache) throws XMLStreamException {
+ protected void serialize(OMOutput omOutput, boolean cache) throws XMLStreamException {
// select the builder
short builderType = PULL_TYPE_BUILDER; // default is pull type
@@ -116,7 +116,5 @@
}
- public String getLocalName() {
- return SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME;
- }
+
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java Sun Jun 26 01:24:38 2005
@@ -48,15 +48,15 @@
}
}
- public void addDetailEntry(OMElement detailElement) {
- throw new UnsupportedOperationException();
- }
-
- public Iterator getAllDetailEntries() {
- throw new UnsupportedOperationException();
- }
+// public void addDetailEntry(OMElement detailElement) {
+// throw new UnsupportedOperationException();
+// }
+//
+// public Iterator getAllDetailEntries() {
+// throw new UnsupportedOperationException();
+// }
- protected void serialize(OMOutput omOutput, boolean cache) throws XMLStreamException {
+ public void serialize(OMOutput omOutput, boolean cache) throws XMLStreamException {
// select the builder
short builderType = PULL_TYPE_BUILDER; // default is pull type
@@ -96,8 +96,5 @@
}
- public String getLocalName() {
- return SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME;
- }
-
+
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultImpl.java Sun Jun 26 01:24:38 2005
@@ -157,7 +157,7 @@
public SOAPFaultDetail getDetail() {
if (faultDetail == null || faultDetail.getParent() != this) {
- faultDetail = (SOAPFaultDetail) this.getChildWithName(SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+ faultDetail = (SOAPFaultDetail) this.getChildWithName(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
}
return faultDetail;
}
@@ -166,6 +166,13 @@
if (!(parent instanceof SOAP11BodyImpl)) {
throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Body as the parent. But received some other implementation");
}
+ }
+
+ public void setDetail(SOAPFaultDetail detail) throws SOAPProcessingException {
+ if (!(detail instanceof SOAP11FaultDetailImpl)) {
+ throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Detail. But received some other implementation");
+ }
+ super.setDetail(detail);
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java Sun Jun 26 01:24:38 2005
@@ -98,7 +98,5 @@
}
- public String getLocalName() {
- return SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME;
- }
+
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java Sun Jun 26 01:24:38 2005
@@ -88,7 +88,5 @@
}
- public String getLocalName() {
- return SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME;
- }
+
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderBlockImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderBlockImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderBlockImpl.java Sun Jun 26 01:24:38 2005
@@ -24,9 +24,8 @@
* License for the specific language governing permissions and limitations under
* the License.
* <p/>
- *
+ * <p/>
* Eran Chinthaka (chinthaka@apache.org)
- *
*/
public class SOAP11HeaderBlockImpl extends SOAPHeaderBlockImpl {
/**
@@ -73,12 +72,12 @@
public void setMustUnderstand(String mustUnderstand) throws SOAPProcessingException {
if (SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_FALSE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_0.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equals(mustUnderstand)) {
setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
- }else{
+ } else {
throw new SOAPProcessingException("mustUndertand should be one of \"true\", \"false\", \"0\" or \"1\" ");
}
}
- /**
+ /**
* Returns whether the mustUnderstand attribute for this
* <CODE>SOAPHeaderBlock</CODE> object is turned on.
*
@@ -86,11 +85,17 @@
* this <CODE>SOAPHeaderBlock</CODE> object is turned on;
* <CODE>false</CODE> otherwise
*/
- public boolean getMustUnderstand() {
+ public boolean getMustUnderstand() throws SOAPProcessingException {
String mustUnderstand = "";
if ((mustUnderstand = getAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI))
!= null) {
- return SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equalsIgnoreCase(mustUnderstand) ;
+ if (SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equalsIgnoreCase(mustUnderstand)) {
+ return true;
+ } else if (SOAPConstants.ATTR_MUSTUNDERSTAND_FALSE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_0.equalsIgnoreCase(mustUnderstand)) {
+ return false;
+ } else {
+ throw new SOAPProcessingException("Invalid value found in mustUnderstand value of " + this.getLocalName() + " header block");
+ }
}
return false;
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap11/SOAP11HeaderImpl.java Sun Jun 26 01:24:38 2005
@@ -76,9 +76,6 @@
}
- public Iterator examineMustUnderstandHeaderBlocks(String actor) {
- throw new UnsupportedOperationException();
- }
-
+
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java Sun Jun 26 01:24:38 2005
@@ -32,7 +32,7 @@
*/
public SOAPEnvelope createSOAPEnvelope() {
- return new SOAPEnvelopeImpl(new OMNamespaceImpl(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX));
+ return new SOAPEnvelopeImpl(new OMNamespaceImpl(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX));
}
public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) throws SOAPProcessingException {
@@ -158,14 +158,11 @@
public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
OMNamespace ns =
new OMNamespaceImpl(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI,
- SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
+ SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns);
- SOAPBodyImpl bodyImpl = new SOAP12BodyImpl(env);
- env.addChild(bodyImpl);
+ SOAPHeader headerImpl = createSOAPHeader(env);
+ SOAPBody bodyImpl = createSOAPBody(env);
- SOAPHeaderImpl headerImpl = new SOAP12HeaderImpl(env);
- headerImpl.setComplete(true);
- env.addChild(headerImpl);
return env;
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultSubCodeImpl.java Sun Jun 26 01:24:38 2005
@@ -51,7 +51,7 @@
}
protected void checkParent(OMElement parent) throws SOAPProcessingException {
- if (!(parent instanceof SOAP12FaultSubCodeImpl) || (parent instanceof SOAP12FaultCodeImpl)) {
+ if (!((parent instanceof SOAP12FaultSubCodeImpl) || (parent instanceof SOAP12FaultCodeImpl))) {
throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP FaultSubCode or SOAP FaultCodeValue as the parent. But received some other implementation");
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultValueImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultValueImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultValueImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12FaultValueImpl.java Sun Jun 26 01:24:38 2005
@@ -38,7 +38,7 @@
}
protected void checkParent(OMElement parent) throws SOAPProcessingException {
- if (!(parent instanceof SOAP12FaultSubCodeImpl)|| (parent instanceof SOAP12FaultCodeImpl)) {
+ if (!((parent instanceof SOAP12FaultSubCodeImpl)|| (parent instanceof SOAP12FaultCodeImpl))) {
throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP FaultSubCode or SOAP FaultCode as the parent. But received some other implementation");
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderBlockImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderBlockImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderBlockImpl.java Sun Jun 26 01:24:38 2005
@@ -68,7 +68,7 @@
}
public void setMustUnderstand(boolean mustUnderstand) {
- setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand ? "1" : "0", SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand ? "1" : "0", SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
}
@@ -80,11 +80,17 @@
}
}
- public boolean getMustUnderstand() {
+ public boolean getMustUnderstand() throws SOAPProcessingException{
String mustUnderstand = "";
if ((mustUnderstand = getAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI))
!= null) {
- return SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equalsIgnoreCase(mustUnderstand);
+ if (SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equalsIgnoreCase(mustUnderstand)) {
+ return true;
+ }else if (SOAPConstants.ATTR_MUSTUNDERSTAND_FALSE.equalsIgnoreCase(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_0.equalsIgnoreCase(mustUnderstand)) {
+ return false;
+ }else{
+ throw new SOAPProcessingException("Invalid value found in mustUnderstand value of "+this.getLocalName() + " header block");
+ }
}
return false;
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderImpl.java?rev=201831&r1=201830&r2=201831&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/soap12/SOAP12HeaderImpl.java Sun Jun 26 01:24:38 2005
@@ -11,6 +11,7 @@
import javax.xml.namespace.QName;
import java.util.Iterator;
+import java.util.ArrayList;
/**
* Copyright 2001-2004 The Apache Software Foundation.
@@ -28,8 +29,8 @@
* the License.
* <p/>
*/
-public class SOAP12HeaderImpl extends SOAPHeaderImpl{
- /**
+public class SOAP12HeaderImpl extends SOAPHeaderImpl {
+ /**
* Eran Chinthaka (chinthaka@apache.org)
*/
@@ -79,7 +80,4 @@
true);
}
- public Iterator examineMustUnderstandHeaderBlocks(String actor) {
- throw new UnsupportedOperationException();
- }
}
Added: webservices/axis/trunk/java/modules/xml/test-resources/soap/invalidMustUnderstandSOAP12.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test-resources/soap/invalidMustUnderstandSOAP12.xml?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test-resources/soap/invalidMustUnderstandSOAP12.xml (added)
+++ webservices/axis/trunk/java/modules/xml/test-resources/soap/invalidMustUnderstandSOAP12.xml Sun Jun 26 01:24:38 2005
@@ -0,0 +1,13 @@
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace">
+ <env:Header>
+ <test2:echoOk2 xmlns:test2="http://example2.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="someOtherValue"
+ env:anyAttribute="any value">
+ foo
+ </test2:echoOk2>
+ </env:Header>
+ <env:Body>
+
+ </env:Body>
+</env:Envelope>
\ No newline at end of file
Added: webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11fault.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11fault.xml?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11fault.xml (added)
+++ webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11fault.xml Sun Jun 26 01:24:38 2005
@@ -0,0 +1,16 @@
+ <SOAP-ENV:Envelope
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <SOAP-ENV:Header>
+ <TestHeader>Test</TestHeader>
+ </SOAP-ENV:Header>
+ <SOAP-ENV:Body>
+ <SOAP-ENV:Fault>
+ <faultcode>SOAP-ENV:MustUnderstand</faultcode>
+ <faultstring>SOAP Must Understand Error</faultstring>
+ <faultactor>Actor</faultactor>
+ <detail>Detail text
+ <SomeElement>Some Element Text</SomeElement>
+ </detail>
+ </SOAP-ENV:Fault>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
\ No newline at end of file
Added: webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11message.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11message.xml?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11message.xml (added)
+++ webservices/axis/trunk/java/modules/xml/test-resources/soap/soap11/soap11message.xml Sun Jun 26 01:24:38 2005
@@ -0,0 +1,47 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <soapenv:Header>
+ <wsa:From soapenv:mustUnderstand="0"
+ soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next">
+ <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous
+ </Address>
+ </wsa:From>
+ <test:MessageID xmlns:test="http://example.org/ts-tests"
+ soapenv:mustUnderstand="1"
+ soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
+ soapenv:anyAttribute="any value">
+ uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5
+ </test:MessageID>
+ <wsa:To soapenv:mustUnderstand="0"
+ soapenv:anyAttribute="any value">
+ http://localhost:8081/axis/services/BankPort
+ </wsa:To>
+ </soapenv:Header>
+ <soapenv:Body>
+ <soapenv:Fault>
+ <soapenv:faultcode>
+ env:Sender
+ </soapenv:faultcode>
+ <soapenv:faultstring>
+ Sender Timeout
+ </soapenv:faultstring>
+ <soapenv:faultactor>
+ http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver
+ </soapenv:faultactor>
+ <soapenv:detail xmlns:m="http://www.sample.org">
+ Details of error
+ <m:MaxTime m:detail="This is only a test">
+ P5M
+ </m:MaxTime>
+ <m:AveTime>
+ <m:Time>
+ P3M
+ </m:Time>
+ </m:AveTime>
+ </soapenv:detail>
+ </soapenv:Fault>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: webservices/axis/trunk/java/modules/xml/test-resources/soap/soap12message.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test-resources/soap/soap12message.xml?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test-resources/soap/soap12message.xml (added)
+++ webservices/axis/trunk/java/modules/xml/test-resources/soap/soap12message.xml Sun Jun 26 01:24:38 2005
@@ -0,0 +1,58 @@
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace">
+ <env:Header>
+ <test:echoOk xmlns:test="http://example.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="true"
+ env:anyAttribute="any value">
+ foo
+ </test:echoOk>
+ <test1:echoOk1 xmlns:test1="http://example1.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
+ env:mustUnderstand="false"
+ env:anyAttribute="any value">
+ foo
+ </test1:echoOk1>
+ <test2:echoOk2 xmlns:test2="http://example2.org/ts-tests"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
+ env:mustUnderstand="1"
+ env:anyAttribute="any value">
+ foo
+ </test2:echoOk2>
+ </env:Header>
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:Sender</env:Value>
+ <env:SubCode>
+ <env:Value>m:MessageTimeout In First SubCode</env:Value>
+ <env:SubCode>
+ <env:Value>m:MessageTimeout In Second SubCode</env:Value>
+ <env:SubCode>
+ <env:Value>m:MessageTimeout In Third SubCode</env:Value>
+ </env:SubCode>
+ </env:SubCode>
+ </env:SubCode>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en">Sender Timeout</env:Text>
+ </env:Reason>
+ <env:Node>
+ http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver
+ </env:Node>
+ <env:Role>
+ ultimateReceiver
+ </env:Role>
+ <env:Detail xmlns:m="http:www.sample.org">
+ Details of error
+ <m:MaxTime m:detail="This is only a test">
+ P5M\n
+ </m:MaxTime>
+ <m:AveTime>
+ <m:Time>
+ P3M\n
+ </m:Time>
+ </m:AveTime>
+ </env:Detail>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
\ No newline at end of file
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+
+public class SOAPBodyTest extends SOAPBodyTestCase {
+
+ public SOAPBodyTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP 1.1 Body Test (Programaticaly created)----------------------------------------------------------------------------------
+ public void testSOAP11AddFault1() {
+ soap11Body.addFault(new Exception("This an exception for testing"));
+ assertTrue("SOAP 1.1 Body Test:- After calling addFault method, SOAP body has no fault", soap11Body.hasFault());
+
+ }
+
+ public void testSOAP11addFault2() {
+ soap11Body.addFault(soap11Factory.createSOAPFault(soap11Body));
+ assertTrue("SOAP 1.1 Body Test:- After calling addFault method, SOAP body has no fault",soap11Body.hasFault());
+
+
+ }
+
+ public void testSOAP11HasFault() {
+ assertFalse("SOAP 1.1 Body Test:- After creating a soap body it has a fault", soap11Body.hasFault());
+ soap11Body.addFault(new Exception("This an exception for testing"));
+ assertTrue("SOAP 1.1 Body Test:- After calling addFault method, hasFault method returns false", soap11Body.hasFault());
+ }
+
+ public void testSOAP11GetFault() {
+ assertTrue("SOAP 1.1 Body Test:- After creating a soap body it has a fault", soap11Body.getFault() == null);
+ soap11Body.addFault(new Exception("This an exception for testing"));
+ assertFalse("SOAP 1.1 Body Test:- After calling addFault method, getFault method returns null", soap11Body.getFault() == null);
+ }
+
+ //SOAP 1.2 Body Test (Programaticaly Created)----------------------------------------------------------------------------------
+ public void testSOAP12AddFault1() {
+ soap12Body.addFault(new Exception("This an exception for testing"));
+ assertTrue("SOAP 1.2 Body Test:- After calling addFault method, SOAP body has no fault", soap12Body.hasFault());
+
+ }
+
+ public void testSOAP12AddFault2() {
+ soap12Body.addFault(soap12Factory.createSOAPFault(soap12Body));
+ assertTrue("SOAP 1.2 Body Test:- After calling addFault method, SOAP body has no fault",soap12Body.hasFault());
+ }
+
+ public void testSOAP12HasFault() {
+ assertFalse("SOAP 1.2 Body Test:- After creating a soap body it has a fault", soap12Body.hasFault());
+ soap12Body.addFault(new Exception("This an exception for testing"));
+ assertTrue("SOAP 1.2 Body Test:- After calling addFault method, hasFault method returns false", soap12Body.hasFault());
+ }
+
+ public void testSOAP12GetFault() {
+ assertTrue("SOAP 1.2 Body Test:- After creating a soap body it has a fault", soap12Body.getFault() == null);
+ soap12Body.addFault(new Exception("This an exception for testing"));
+ assertFalse("SOAP 1.2 Body Test:- After calling addFault method, getFault method returns null", soap12Body.getFault() == null);
+ }
+
+ //SOAP 1.1 Body Test (With Parser)-------------------------------------------------------------------------------------------
+ public void testSOAP11HasFaultWithParser() {
+ assertTrue("SOAP 1.1 Body Test With parser :- hasFault method returns false", soap11BodyWithParser.hasFault());
+ }
+
+ public void testSOAP11GetFaultWithParser() {
+ assertFalse("SOAP 1.1 Body Test With parser :- getFault method returns null", soap11BodyWithParser.getFault() == null);
+ assertTrue("SOAP 1.1 Body Test With parser : - SOAP fault name mismatch",soap11BodyWithParser.getFault().getLocalName().equals(SOAPConstants.SOAPFAULT_LOCAL_NAME));
+ }
+
+ //SOAP 1.2 Body Test (With Parser)-------------------------------------------------------------------------------------------------
+ public void testSOAP12HasFaultWithParser() {
+ assertTrue("SOAP 1.2 Body Test With parser :- hasFault method returns false", soap12BodyWithParser.hasFault());
+ }
+
+ public void testSOAP12GetFaultWithParser() {
+ assertFalse("SOAP 1.2 Body Test With parser :- getFault method returns null", soap12BodyWithParser.getFault() == null);
+ assertTrue("SOAP 1.2 Body Test With parser : - SOAP fault name mismatch",soap12BodyWithParser.getFault().getLocalName().equals(SOAPConstants.SOAPFAULT_LOCAL_NAME));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTestCase.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTestCase.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPBodyTestCase.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPBodyTestCase extends SOAPTestCase {
+ protected SOAPBody soap11Body;
+ protected SOAPBody soap12Body;
+
+ protected SOAPBody soap11BodyWithParser;
+ protected SOAPBody soap12BodyWithParser;
+
+ public SOAPBodyTestCase(String testName) {
+ super(testName);
+
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11Body = soap11Factory.createSOAPBody(soap11Envelope);
+ soap12Body = soap12Factory.createSOAPBody(soap12Envelope);
+
+ soap11BodyWithParser = soap11EnvelopeWithParser.getBody();
+ soap12BodyWithParser = soap12EnvelopeWithParser.getBody();
+ }
+
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPEnvelopeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPEnvelopeTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPEnvelopeTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPEnvelopeTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+
+public class SOAPEnvelopeTest extends SOAPTestCase {
+ protected SOAPEnvelope soap11Envelope;
+ protected SOAPEnvelope soap12Envelope;
+
+ public SOAPEnvelopeTest(String testName) {
+ super(testName);
+ soap11Envelope = soap11Factory.getDefaultEnvelope();
+ soap12Envelope = soap12Factory.getDefaultEnvelope();
+ }
+
+ //SOAP 1.1 Envelope Test (Programaticaly Created)-----------------------------------------------
+ public void testSOAP11GetHeader() {
+ SOAPHeader header = soap11Envelope.getHeader();
+ assertTrue("SOAP 1.1 Header Test : - Header local name mismatch", header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
+ assertTrue("SOAP 1.1 Header Test : - Header namespace mismatch", header.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ public void testSOAP11GetBody() {
+ SOAPBody body = soap11Envelope.getBody();
+ assertTrue("SOAP 1.1 Body Test : - Body local name mismatch", body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ assertTrue("SOAP 1.1 Body Test : - Body namespace mismatch", body.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ //SOAP 1.2 Envelope Test (Programaticaly Created)-------------------------------------------------
+ public void testSOAP12GetHeader() {
+ SOAPHeader header = soap12Envelope.getHeader();
+ assertTrue("SOAP 1.2 Header Test : - Header local name mismatch", header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
+ assertTrue("SOAP 1.2 Header Test : - Header namespace mismatch", header.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ public void testSOAP12GetBody() {
+ SOAPBody body = soap12Envelope.getBody();
+ assertTrue("SOAP 1.2 Body Test : - Body local name mismatch", body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ assertTrue("SOAP 1.2 Body Test : - Body namespace mismatch", body.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ //SOAP 1.1 Envelope Test (With Parser)-----------------------------------------------------------------
+ public void testSOAP11GetHeaderWithParser() {
+ SOAPHeader header = soap11EnvelopeWithParser.getHeader();
+ assertTrue("SOAP 1.1 Header Test : - Header local name mismatch", header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
+ assertTrue("SOAP 1.1 Header Test : - Header namespace mismatch", header.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ public void testSOAP11GetBodyWithParser() {
+ SOAPBody body = soap11EnvelopeWithParser.getBody();
+ assertTrue("SOAP 1.1 Body Test : - Body local name mismatch", body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ assertTrue("SOAP 1.1 Body Test : - Body namespace mismatch", body.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ //SOAP 1.2 Envelope Test (With Parser)--------------------------------------------------------------------
+ public void testSOAP12GetHeaderWithParser() {
+ SOAPHeader header = soap12EnvelopeWithParser.getHeader();
+ assertTrue("SOAP 1.2 Header Test : - Header local name mismatch", header.getLocalName().equals(SOAPConstants.HEADER_LOCAL_NAME));
+ assertTrue("SOAP 1.2 Header Test : - Header namespace mismatch", header.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+
+ public void testSOAP12GetBodyWithParser() {
+ SOAPBody body = soap12EnvelopeWithParser.getBody();
+ assertTrue("SOAP 1.2 Body Test : - Body local name mismatch", body.getLocalName().equals(SOAPConstants.BODY_LOCAL_NAME));
+ assertTrue("SOAP 1.2 Body Test : - Body namespace mismatch", body.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.soap.impl.llom.SOAPProcessingException;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+
+public class SOAPFaultCodeTest extends SOAPFaultCodeTestCase {
+
+ public SOAPFaultCodeTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ //SOAP 1.1 Fault Code Test (Programaticaly Created)
+ public void testSOAP11SetValue() {
+ soap11FaultCode.setValue(soap11Factory.createSOAPFaultValue(soap11FaultCode));
+ assertFalse("SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",soap11FaultCode.getValue() == null);
+ try{
+ soap11FaultCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultCode));
+ fail("SOAP12FaultValue should not be inserted to SOAP11FaultCode");
+ } catch (SOAPProcessingException e) {
+ assertTrue(true);
+ }
+
+ }
+
+ public void testSOAP11GetValue() {
+ assertTrue("SOAP 1.1 Fault Code Test :- After creating soapfaultcode, it has a value",soap11FaultCode.getValue() == null);
+ soap11FaultCode.setValue(soap11Factory.createSOAPFaultValue(soap11FaultCode));
+ assertFalse("SOAP 1.1 Fault Code Test :- After calling setValue method, getValue method returns null",soap11FaultCode.getValue() == null);
+ }
+
+ //SOAP 1.2 Fault Code Test (Programaticaly Created)
+ public void testSOAP12SetValue() {
+ soap12FaultCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultCode));
+ assertFalse("SOAP 1.2 Fault Code Test :- After calling setValue method, getValue method returns null",soap12FaultCode.getValue() == null);
+ try{
+ soap12FaultCode.setValue(soap11Factory.createSOAPFaultValue(soap11FaultCode));
+ fail("SOAP11FaultValue should not be inserted to SOAP12FaultCode");
+ } catch (SOAPProcessingException e) {
+ assertTrue(true);
+ }
+
+ try {
+ soap12FaultCode.setValue(soap12Factory.createSOAPFaultValue(soap12Factory.createSOAPFaultSubCode(soap12FaultCode)));
+ } catch (Exception e) {
+ fail("SOAP 1.2 Fault Code Test :- When calling setValue method, parent of value element mismatch");
+ }
+ }
+
+ public void testSOAP12GetValue() {
+ assertTrue("SOAP 1.2 Fault Code Test :- After creating soapfaultcode, it has a value",soap12FaultCode.getValue() == null);
+ soap12FaultCode.setValue(soap12Factory.createSOAPFaultValue(soap12FaultCode));
+ assertFalse("SOAP 1.2 Fault Code Test :- After calling setValue method, getValue method returns null",soap12FaultCode.getValue() == null);
+ }
+
+ public void testSOAP12SetSubCode() {
+ soap12FaultCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultCode));
+ assertFalse("SOAP 1.2 Fault Code Test :- After calling setSubCode method, getSubCode method returns null",soap12FaultCode.getSubCode() == null);
+ try{
+ soap12FaultCode.setSubCode(soap11Factory.createSOAPFaultSubCode(soap11FaultCode));
+ fail("SOAP11FaultSubCode should not be inserted to SOAP12FaultCode");
+ } catch (SOAPProcessingException e) {
+ assertTrue(true);
+ }
+
+ try {
+ soap12FaultCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultCode)));
+ } catch (Exception e) {
+ fail("SOAP 1.2 Fault Code Test :- When calling setSubCode method, parent of subcode element mismatch");
+ }
+ }
+
+ public void testSOAP12GetSubCode() {
+ assertTrue("SOAP 1.2 Fault Code Test :- After creating soapfaultcode, it has a subcode",soap12FaultCode.getSubCode() == null);
+ soap12FaultCode.setSubCode(soap12Factory.createSOAPFaultSubCode(soap12FaultCode));
+ assertFalse("SOAP 1.2 Fault Code Test :- After calling setSubCode method, getSubCode method returns null",soap12FaultCode.getSubCode() == null);
+ }
+
+ //SOAP 1.1 Fault Code Test (With Parser)
+ public void testSOAP11GetValueWithParser() {
+ assertFalse("SOAP 1.1 Fault Code Test with parser : - getValue method returns null",soap11FaultCodeWithParser.getValue() == null);
+ assertTrue("SOAP 1.1 Fault Code Test with parser : - Value local name mismatch",soap11FaultCodeWithParser.getValue().getLocalName().equals(SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
+ }
+
+ //SOAP 1.2 Fault Code Test (With Parser)
+ public void testSOAP12GetValueWithParser() {
+ assertFalse("SOAP 1.2 Fault Code Test with parser : - getValue method returns null",soap12FaultCodeWithParser.getValue() == null);
+ assertTrue("SOAP 1.2 Fault Code Test with parser : - Value local name mismatch",soap12FaultCodeWithParser.getValue().getLocalName().equals(SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME));
+ }
+
+ public void testSOAP12GetSubCodeWithParser() {
+ assertFalse("SOAP 1.2 Fault Code Test with parser :- getSubCode method returns null",soap12FaultCodeWithParser.getSubCode() == null);
+ assertTrue("SOAP 1.2 Fault Code Test with parser : - subcode local name mismatch",soap12FaultCodeWithParser.getSubCode().getLocalName().equals(SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME));
+ }
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTestCase.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTestCase.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultCodeTestCase.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+public class SOAPFaultCodeTestCase extends SOAPFaultTestCase {
+
+ protected SOAPFaultCode soap11FaultCode;
+ protected SOAPFaultCode soap12FaultCode;
+
+ protected SOAPFaultCode soap11FaultCodeWithParser;
+ protected SOAPFaultCode soap12FaultCodeWithParser;
+
+ public SOAPFaultCodeTestCase(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ soap11FaultCode = soap11Factory.createSOAPFaultCode(soap11Fault);
+ soap12FaultCode = soap12Factory.createSOAPFaultCode(soap12Fault);
+
+ soap11FaultCodeWithParser = soap11FaultWithParser.getCode();
+ soap12FaultCodeWithParser = soap12FaultWithParser.getCode();
+ }
+
+}
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultDetailTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultDetailTest.java?rev=201831&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultDetailTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/soap/SOAPFaultDetailTest.java Sun Jun 26 01:24:38 2005
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.soap;
+
+import org.apache.axis.om.*;
+
+import java.util.Iterator;
+
+public class SOAPFaultDetailTest extends SOAPFaultTestCase {
+ protected SOAPFaultDetail soap11FaultDetail;
+ protected SOAPFaultDetail soap12FaultDetail;
+ protected SOAPFaultDetail soap11FaultDetailWithParser;
+ protected SOAPFaultDetail soap12FaultDetailWithParser;
+ protected OMNamespace omNamespace;
+
+ public SOAPFaultDetailTest(String testName) {
+ super(testName);
+ omNamespace = omFactory.createOMNamespace("http://www.test.org","test");
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ soap11FaultDetail = soap11Factory.createSOAPFaultDetail(soap11Fault);
+ soap12FaultDetail = soap12Factory.createSOAPFaultDetail(soap12Fault);
+ soap11FaultDetailWithParser = soap11FaultWithParser.getDetail();
+ soap12FaultDetailWithParser = soap12FaultWithParser.getDetail();
+ }
+
+ //SOAP 1.1 Fault Detail Test (Programaticaly Created)
+ public void testSOAP11AddDetailEntry() {
+ soap11FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry1",omNamespace));
+ soap11FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry2",omNamespace));
+ Iterator iterator = soap11FaultDetail.getAllDetailEntries();
+ OMElement detailEntry1 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns empty iterator",detailEntry1 == null);
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry1 local name mismatch",detailEntry1.getLocalName().equals("DetailEntry1"));
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry1 namespace uri mismatch",detailEntry1.getNamespace().getName().equals("http://www.test.org"));
+ OMElement detailEntry2 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns an iterator with only one object",detailEntry2 == null);
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry2 local name mismatch",detailEntry2.getLocalName().equals("DetailEntry2"));
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry2 namespace uri mismatch",detailEntry2.getNamespace().getName().equals("http://www.test.org"));
+ assertTrue("SOAP 1.1 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns an iterator with three objects",iterator.next() == null);
+ }
+
+ public void testSOAP11GetAllDetailEntries() {
+ Iterator iterator = soap11FaultDetail.getAllDetailEntries();
+ assertTrue("SOAP 1.1 Fault Detail Test : - After creating SOAP11FaultDetail element, it has DetailEntries",iterator.next() == null);
+ soap11FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry",omNamespace));
+ iterator = soap11FaultDetail.getAllDetailEntries();
+ OMElement detailEntry = (OMElement)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test : - After calling addDetailEntry method, getAllDetailEntries method returns empty iterator",detailEntry == null);
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry local name mismatch",detailEntry.getLocalName().equals("DetailEntry"));
+ assertTrue("SOAP 1.1 Fault Detail Test : - detailEntry namespace uri mismatch",detailEntry.getNamespace().getName().equals("http://www.test.org"));
+ assertTrue("SOAP 1.1 Fault Detail Test : - After calling addDetailEntry method once, getAllDetailEntries method returns an iterator with two objects",iterator.next() == null);
+ }
+
+ //SOAP 1.2 Fault Detail Test (Programaticaly Created)
+ public void testSOAP12AddDetailEntry() {
+ soap12FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry1",omNamespace));
+ soap12FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry2",omNamespace));
+ Iterator iterator = soap12FaultDetail.getAllDetailEntries();
+ OMElement detailEntry1 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns empty iterator",detailEntry1 == null);
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry1 local name mismatch",detailEntry1.getLocalName().equals("DetailEntry1"));
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry1 namespace uri mismatch",detailEntry1.getNamespace().getName().equals("http://www.test.org"));
+ OMElement detailEntry2 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns an iterator with only one object",detailEntry2 == null);
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry2 local name mismatch",detailEntry2.getLocalName().equals("DetailEntry2"));
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry2 namespace uri mismatch",detailEntry2.getNamespace().getName().equals("http://www.test.org"));
+ assertTrue("SOAP 1.2 Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns an iterator with three objects",iterator.next() == null);
+ }
+
+ public void testSOAP12GetAllDetailEntries() {
+ Iterator iterator = soap12FaultDetail.getAllDetailEntries();
+ assertTrue("SOAP 1.2 Fault Detail Test : - After creating SOAP11FaultDetail element, it has DetailEntries",iterator.next() == null);
+ soap12FaultDetail.addDetailEntry(omFactory.createOMElement("DetailEntry",omNamespace));
+ iterator = soap12FaultDetail.getAllDetailEntries();
+ OMElement detailEntry = (OMElement)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test : - After calling addDetailEntry method, getAllDetailEntries method returns empty iterator",detailEntry == null);
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry local name mismatch",detailEntry.getLocalName().equals("DetailEntry"));
+ assertTrue("SOAP 1.2 Fault Detail Test : - detailEntry namespace uri mismatch",detailEntry.getNamespace().getName().equals("http://www.test.org"));
+ assertTrue("SOAP 1.2 Fault Detail Test : - After calling addDetailEntry method once, getAllDetailEntries method returns an iterator with two objects",iterator.next() == null);
+ }
+
+ //SOAP 1.1 Fault Detail Test (With Parser)
+ public void testSOAP11GetAllDetailEntriesWithParser() {
+ Iterator iterator = soap11FaultDetailWithParser.getAllDetailEntries();
+ OMText textEntry = (OMText)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test With Parser : - getAllDetailEntries method returns empty iterator",textEntry == null);
+ assertTrue("SOAP 1.1 Fault Detail Test With Parser : - text value mismatch",textEntry.getText().trim().equals("Details of error"));
+ OMElement detailEntry1 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator without detail entries",detailEntry1 == null);
+ assertTrue("SOAP 1.1 Fault Detail Test With Parser : - detailEntry1 localname mismatch",detailEntry1.getLocalName().equals("MaxTime"));
+ iterator.next();
+ OMElement detailEntry2 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.1 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator with only one detail entries",detailEntry2 == null);
+ assertTrue("SOAP 1.1 Fault Detail Test With Parser : - detailEntry2 localname mismatch",detailEntry2.getLocalName().equals("AveTime"));
+ iterator.next();
+ assertTrue("SOAP 1.1 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator with more than two detail entries",iterator.next() == null);
+ }
+
+ //SOAP 1.2 Fault Detail Test (With Parser)
+ public void testSOAP12GetAllDetailEntriesWithParser() {
+ Iterator iterator = soap12FaultDetailWithParser.getAllDetailEntries();
+ OMText textEntry = (OMText)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test With Parser : - getAllDetailEntries method returns empty iterator",textEntry == null);
+ assertTrue("SOAP 1.2 Fault Detail Test With Parser : - text value mismatch",textEntry.getText().trim().equals("Details of error"));
+ OMElement detailEntry1 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator without detail entries",detailEntry1 == null);
+ assertTrue("SOAP 1.2 Fault Detail Test With Parser : - detailEntry1 localname mismatch",detailEntry1.getLocalName().equals("MaxTime"));
+ iterator.next();
+ OMElement detailEntry2 = (OMElement)iterator.next();
+ assertFalse("SOAP 1.2 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator with only one detail entries",detailEntry2 == null);
+ assertTrue("SOAP 1.2 Fault Detail Test With Parser : - detailEntry2 localname mismatch",detailEntry2.getLocalName().equals("AveTime"));
+ iterator.next();
+ assertTrue("SOAP 1.2 Fault Detail Test With Parser : - getAllDetailEntries method returns an itrator with more than two detail entries",iterator.next() == null);
+ }
+}