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 2004/12/08 12:06:25 UTC
svn commit: r111249 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/impl/llom java/org/apache/axis/impl/llom/builder java/org/apache/axis/impl/llom/factory java/org/apache/axis/impl/llom/wrapper java/org/apache/axis/om test/org/apache/axis/om
Author: chinthaka
Date: Wed Dec 8 03:06:21 2004
New Revision: 111249
URL: http://svn.apache.org/viewcvs?view=rev&rev=111249
Log:
SOAPBody todos completed with test cases
Added:
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPFaultImpl.java
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPBodyImpl.java Wed Dec 8 03:06:21 2004
@@ -1,13 +1,9 @@
package org.apache.axis.impl.llom;
-import org.apache.axis.om.OMConstants;
-import org.apache.axis.om.OMElement;
-import org.apache.axis.om.OMException;
-import org.apache.axis.om.SOAPFault;
-import org.apache.axis.om.OMNamespace;
-import org.apache.axis.om.OMXMLParserWrapper;
-import org.apache.axis.om.SOAPBody;
-import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.om.*;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
/**
* Copyright 2001-2004 The Apache Software Foundation.
@@ -28,8 +24,9 @@
* Date: Nov 2, 2004
* Time: 4:29:00 PM
*/
-public class SOAPBodyImpl extends OMElementImpl implements SOAPBody {
+public class SOAPBodyImpl extends OMElementImpl implements SOAPBody, OMConstants {
+ private boolean hasSOAPFault = false;
/**
@@ -53,7 +50,9 @@
* @throws org.apache.axis.om.OMException if there is a SOAP error
*/
public SOAPFault addFault() throws OMException {
- throw new UnsupportedOperationException(); //TODO implement this
+ SOAPFault soapFault = new SOAPFaultImpl(this);
+ addFault(soapFault);
+ return soapFault;
}
/**
@@ -65,7 +64,16 @@
* otherwise
*/
public boolean hasFault() {
- throw new UnsupportedOperationException(); //TODO implement this
+ if (hasSOAPFault) {
+ return true;
+ } else {
+ Iterator soapFaultChildren = getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_LOCAL_NAME));
+ if (soapFaultChildren.hasNext()) {
+ hasSOAPFault = true;
+ return true;
+ }
+ }
+ return false;
}
/**
@@ -76,7 +84,12 @@
* object
*/
public SOAPFault getFault() {
- throw new UnsupportedOperationException(); //TODO implement this
+ Iterator soapFaultChildren = getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_LOCAL_NAME));
+ if (soapFaultChildren.hasNext()) {
+ SOAPFault soapFault = (SOAPFault) soapFaultChildren.next();
+ return soapFault;
+ }
+ return null;
}
@@ -85,7 +98,12 @@
* @throws org.apache.axis.om.OMException
*/
public void addFault(SOAPFault soapFault) throws OMException {
- throw new UnsupportedOperationException(); //TODO implement this
+ if(hasSOAPFault){
+ throw new OMException("SOAP Body already has a SOAP Fault and there can not be more than one SOAP fault");
+ }
+ addChild(soapFault);
+ hasSOAPFault = true;
+
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPEnvelopeImpl.java Wed Dec 8 03:06:21 2004
@@ -32,7 +32,7 @@
* Date: Oct 29, 2004
* Time: 3:41:59 PM
*/
-public class SOAPEnvelopeImpl extends OMElementImpl implements SOAPEnvelope {
+public class SOAPEnvelopeImpl extends OMElementImpl implements SOAPEnvelope, OMConstants {
/**
*
@@ -40,6 +40,8 @@
*/
public SOAPEnvelopeImpl(OMXMLParserWrapper builder){
super("",null,null,builder);
+ this.localName = SOAPENVELOPE_LOCAL_NAME;
+
}
public SOAPEnvelopeImpl(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPFaultImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPFaultImpl.java?view=auto&rev=111249
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/SOAPFaultImpl.java Wed Dec 8 03:06:21 2004
@@ -0,0 +1,66 @@
+package org.apache.axis.impl.llom;
+
+import org.apache.axis.om.*;
+
+import javax.xml.namespace.QName;
+import java.util.Locale;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ * User: Eran Chinthaka - Lanka Software Foundation
+ * Date: Dec 8, 2004
+ * Time: 2:02:25 PM
+ */
+public class SOAPFaultImpl extends OMElementImpl implements SOAPFault, OMConstants{
+
+ public SOAPFaultImpl(OMElement parent) {
+ super(parent);
+ localName = SOAPFAULT_LOCAL_NAME;
+ setNamespace(new OMNamespaceImpl(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_NAMESPACE_PREFIX));
+ }
+
+ public SOAPFaultImpl(OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ super(SOAPFAULT_LOCAL_NAME, ns, parent, builder);
+ }
+
+ public void setFaultCode(QName faultCode) throws OMException {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public QName getFaultCode() {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public void setFaultActor(String faultActor) throws OMException {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public String getFaultActor() {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public void setFaultString(String faultString) throws OMException {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public String getFaultString() {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+
+ public void setFaultString(String faultString, Locale locale) throws OMException {
+ throw new UnsupportedOperationException(); //TODO implement this
+ }
+}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/builder/StAXSOAPModelBuilder.java Wed Dec 8 03:06:21 2004
@@ -62,7 +62,7 @@
String elementName = parser.getLocalName();
if (lastNode == null) {
- envelope = ombuilderFactory.createOMEnvelope(elementName, null, null, this);
+ envelope = ombuilderFactory.createSOAPEnvelope(elementName, null, null, this);
node = (OMElementImpl) envelope;
} else if (lastNode.isComplete()) {
node = constructNode(lastNode.getParent(), elementName);
@@ -91,10 +91,10 @@
// this is either a header or a body
if (elementName.equalsIgnoreCase("Header")) {
//since its level 2 parent MUST be the envelope
- element = ombuilderFactory.createHeader(elementName, null, parent, this);
+ element = ombuilderFactory.createSOAPHeader(elementName, null, parent, this);
} else if (elementName.equalsIgnoreCase("Body")) {
//since its level 2 parent MUST be the envelope
- element = ombuilderFactory.createOMBody(elementName, null, parent, this);
+ element = ombuilderFactory.createSOAPBody(elementName, null, parent, this);
} else {
// can there be Elements other than Header and Body in Envelope. If yes, what are they and is it YAGNI ??
throw new OMException(elementName + " is not supported here. Envelope can not have elements other than Header and Body.");
@@ -102,11 +102,11 @@
} else if (elementLevel == 3 && parent.getLocalName().equalsIgnoreCase("Header")) {
// this is a headerblock
- element = ombuilderFactory.createOMHeaderBlock(elementName, null, parent, this);//todo NS is required here
+ element = ombuilderFactory.createSOAPHeaderBlock(elementName, null, parent, this);//todo NS is required here
} else {
// this is neither of above. Just create an element
- element = ombuilderFactory.createOMElement(elementName, null, parent, this);//todo put the namespace
+ element = ombuilderFactory.createOMElement(elementName, null, parent, this);//todo put the name
}
return element;
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/factory/OMLinkedListImplFactory.java Wed Dec 8 03:06:21 2004
@@ -1,28 +1,7 @@
package org.apache.axis.impl.llom.factory;
-import org.apache.axis.impl.llom.OMAttributeImpl;
-import org.apache.axis.impl.llom.OMElementImpl;
-import org.apache.axis.impl.llom.OMNamedNodeImpl;
-import org.apache.axis.impl.llom.OMNamespaceImpl;
-import org.apache.axis.impl.llom.OMNodeImpl;
-import org.apache.axis.impl.llom.OMTextImpl;
-import org.apache.axis.impl.llom.SOAPBodyImpl;
-import org.apache.axis.impl.llom.SOAPEnvelopeImpl;
-import org.apache.axis.impl.llom.SOAPHeaderBlockImpl;
-import org.apache.axis.impl.llom.SOAPHeaderImpl;
-import org.apache.axis.om.OMAttribute;
-import org.apache.axis.om.OMConstants;
-import org.apache.axis.om.OMElement;
-import org.apache.axis.om.OMFactory;
-import org.apache.axis.om.OMNamedNode;
-import org.apache.axis.om.OMNamespace;
-import org.apache.axis.om.OMNode;
-import org.apache.axis.om.OMText;
-import org.apache.axis.om.OMXMLParserWrapper;
-import org.apache.axis.om.SOAPBody;
-import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.om.SOAPHeader;
-import org.apache.axis.om.SOAPHeaderBlock;
+import org.apache.axis.impl.llom.*;
+import org.apache.axis.om.*;
/**
* Copyright 2001-2004 The Apache Software Foundation.
@@ -88,19 +67,19 @@
return new OMTextImpl(s);
}
- public SOAPBody createOMBody(SOAPEnvelope envelope) {
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope) {
return new SOAPBodyImpl(envelope);
}
- public SOAPBody createOMBody(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ public SOAPBody createSOAPBody(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
return new SOAPBodyImpl(localName, ns, parent, builder);
}
- public SOAPEnvelope createOMEnvelope(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ public SOAPEnvelope createSOAPEnvelope(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
return new SOAPEnvelopeImpl(localName, ns, parent, builder);
}
- public SOAPEnvelope createOMEnvelope(String localName, OMNamespace ns) {
+ public SOAPEnvelope createSOAPEnvelope(String localName, OMNamespace ns) {
return new SOAPEnvelopeImpl(localName, ns);
}
@@ -110,20 +89,28 @@
//TODO there should be a method to create an SOAPEnvelope giving OMXMLParserWrapper, as OMMessage is no longer there
- public SOAPHeader createHeader(SOAPEnvelope envelope) {
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) {
return new SOAPHeaderImpl(envelope);
}
- public SOAPHeader createHeader(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ public SOAPHeader createSOAPHeader(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
return new SOAPHeaderImpl(localName, ns, parent, builder);
}
- public SOAPHeaderBlock createOMHeaderBlock(String localName, OMNamespace ns) {
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns) {
return new SOAPHeaderBlockImpl(localName, ns);
}
- public SOAPHeaderBlock createOMHeaderBlock(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
return new SOAPHeaderBlockImpl(localName, ns, parent, builder);
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent) {
+ return new SOAPFaultImpl(parent);
+ }
+
+ public SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent, OMXMLParserWrapper builder) {
+ return new SOAPFaultImpl(ns, parent, builder);
}
public SOAPEnvelope getDefaultEnvelope() {
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/wrapper/OMXPPWrapper.java Wed Dec 8 03:06:21 2004
@@ -65,7 +65,7 @@
OMElementImpl node;
String elementName = parser.getName();
if (lastNode == null) {
- envelope = ombuilderFactory.createOMEnvelope(elementName, null, null, this);
+ envelope = ombuilderFactory.createSOAPEnvelope(elementName, null, null, this);
node = (OMElementImpl) envelope;
// root = new OMElementImpl(parser.getName(), null, null, this);
// node = root;
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMConstants.java Wed Dec 8 03:06:21 2004
@@ -19,7 +19,7 @@
* Date: Nov 8, 2004
* Time: 3:38:10 PM
*/
-public class OMConstants {
+public interface OMConstants {
public static final String SOAP_ENVELOPE_NAMESPACE_URI = "http://schemas.xmlsoap.org/soap/envelope/";
public static final String SOAPENVELOPE_NAMESPACE_PREFIX = "soapenv";
@@ -38,4 +38,8 @@
// Attribute names of a SOAP Envelope
public static final String ATTR_ACTOR = "actor";
public static final String ATTR_MUSTUNDERSTAND = "mustUnderstand";
+
+ public static final String SOAPFAULT_LOCAL_NAME = "Fault";
+ public static final String SOAPFAULT_NAMESPACE_URI = SOAP_ENVELOPE_NAMESPACE_URI;
+ public static final String SOAPFAULT_NAMESPACE_PREFIX = SOAPENVELOPE_NAMESPACE_PREFIX;
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMFactory.java Wed Dec 8 03:06:21 2004
@@ -1,7 +1,6 @@
package org.apache.axis.om;
-
/**
* Copyright 2001-2004 The Apache Software Foundation.
* <p/>
@@ -101,7 +100,7 @@
* @param envelope
* @return
*/
- public abstract SOAPBody createOMBody(SOAPEnvelope envelope);
+ public abstract SOAPBody createSOAPBody(SOAPEnvelope envelope);
/**
* @param localName
@@ -110,7 +109,7 @@
* @param builder
* @return
*/
- public abstract SOAPBody createOMBody(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
+ public abstract SOAPBody createSOAPBody(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
/**
@@ -120,18 +119,18 @@
* @param builder
* @return
*/
- public abstract SOAPEnvelope createOMEnvelope(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
+ public abstract SOAPEnvelope createSOAPEnvelope(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
/**
* @param localName
* @param ns
*/
- public abstract SOAPEnvelope createOMEnvelope(String localName, OMNamespace ns);
+ public abstract SOAPEnvelope createSOAPEnvelope(String localName, OMNamespace ns);
/**
* @param envelope
*/
- public abstract SOAPHeader createHeader(SOAPEnvelope envelope);
+ public abstract SOAPHeader createSOAPHeader(SOAPEnvelope envelope);
/**
* @param localName
@@ -140,15 +139,14 @@
* @param builder
* @return
*/
- public abstract SOAPHeader createHeader(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
-
+ public abstract SOAPHeader createSOAPHeader(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
/**
* @param localName
* @param ns
*/
- public abstract SOAPHeaderBlock createOMHeaderBlock(String localName, OMNamespace ns);
+ public abstract SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns);
/**
* @param localName
@@ -157,14 +155,28 @@
* @param builder
* @return
*/
- public abstract SOAPHeaderBlock createOMHeaderBlock(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
+ public abstract SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder);
+
+ /**
+ * @param parent
+ * @return
+ */
+ public abstract SOAPFault createSOAPFault(SOAPBody parent);
+
+ /**
+ * @param ns
+ * @param parent
+ * @param builder
+ * @return
+ */
+ public abstract SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent, OMXMLParserWrapper builder);
//make the constructor protected
protected OMFactory() {
}
- public static OMFactory newInstance(){
+ public static OMFactory newInstance() {
return FactoryFinder.findFactory(null);
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/om/OMNode.java Wed Dec 8 03:06:21 2004
@@ -1,5 +1,6 @@
package org.apache.axis.om;
+import org.apache.axis.impl.llom.OMNodeImpl;
/**
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMBodyTest.java Wed Dec 8 03:06:21 2004
@@ -22,8 +22,9 @@
import java.util.Iterator;
import org.apache.axis.impl.llom.OMNamespaceImpl;
+import org.apache.axis.impl.llom.serialize.SimpleOMSerializer;
-public class OMBodyTest extends OMTestCase {
+public class OMBodyTest extends OMTestCase implements OMConstants{
SOAPBody soapBody;
@@ -46,34 +47,17 @@
* Class under test for SOAPFault addFault()
*/
public void testAddFault() {
- //TODO Implement addFault().
- }
-
- public void testHasFault() {
- //TODO Implement hasFault().
- }
+ System.out.println("Adding SOAP fault to body ....");
+ soapBody.addChild(ombuilderFactory.createSOAPFault(soapBody));
- public void testGetFault() {
- //TODO Implement getFault().
- }
+ System.out.println("\t checking for SOAP Fault ...");
+ assertTrue("SOAP body has no SOAP fault", soapBody.hasFault());
- public void testAddBodyElement() {
- String newElementName = "MyBodyElement";
- soapBody.addChild(ombuilderFactory.createOMElement(newElementName, new OMNamespaceImpl("http://opensource.lk", "lsf")));
+ System.out.println("\t checking for not-nullity ...");
+ assertTrue("SOAP body has no SOAP fault", soapBody.getFault() != null);
- Iterator children = soapBody.getChildren();
- // TODO test this
+// SimpleOMSerializer simpleOMSerializer = new SimpleOMSerializer();
+// simpleOMSerializer.serialize(soapBody, System.out);
}
-
- /*
- * Class under test for void addFault(SOAPFault)
- */
- public void testAddFaultSOAPFault() {
- //TODO Implement addFault().
- }
-
- public void testAddDocument() {
- //TODO Implement addDocument().
- }
-
+
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java?view=diff&rev=111249&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java&r1=111248&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java&r2=111249
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/om/OMTestCase.java Wed Dec 8 03:06:21 2004
@@ -26,7 +26,7 @@
* Date: Nov 2, 2004
* Time: 2:15:28 PM
*/
-public abstract class OMTestCase extends AbstractTestCase {
+public class OMTestCase extends AbstractTestCase {
protected static final String IN_FILE_NAME = "soap/soapmessage.xml";
protected OMXPPWrapper omXmlPullParserWrapper;