You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ru...@apache.org on 2006/03/27 10:02:11 UTC
svn commit: r389047 [6/7] - in /webservices/commons/trunk/modules/axiom: ./
src/org/apache/axiom/om/impl/dom/ src/org/apache/axiom/om/impl/dom/factory/
src/org/apache/axiom/om/impl/dom/jaxp/
src/org/apache/axiom/om/impl/dom/msg/ src/org/apache/axiom/so...
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,108 @@
+/*
+ * 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.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.dom.AttrImpl;
+import org.apache.axiom.om.impl.dom.ElementImpl;
+import org.apache.axiom.om.impl.dom.NamespaceImpl;
+import org.apache.axiom.om.impl.dom.ParentNode;
+import org.apache.axiom.soap.SOAPConstants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+
+import javax.xml.namespace.QName;
+
+public abstract class SOAPHeaderBlockImpl extends ElementImpl implements SOAPHeaderBlock {
+
+ private boolean processed = false;
+
+ /**
+ * @param localName
+ * @param ns
+ * @param parent
+ */
+ public SOAPHeaderBlockImpl(String localName, OMNamespace ns,
+ SOAPHeader parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super((ParentNode)parent, localName,(NamespaceImpl) ns, factory);
+ this.setNamespace(ns);
+ }
+
+ /**
+ * Constructor SOAPHeaderBlockImpl.
+ *
+ * @param localName
+ * @param ns
+ * @param parent
+ * @param builder
+ */
+ public SOAPHeaderBlockImpl(String localName, OMNamespace ns,
+ OMElement parent, OMXMLParserWrapper builder, SOAPFactory factory) {
+ super((ParentNode)parent, localName, (NamespaceImpl)ns, builder, factory);
+ this.setNamespace(ns);
+ }
+
+ /**
+ * @param attributeName
+ * @param attrValue
+ * @param soapEnvelopeNamespaceURI
+ */
+ protected void setAttribute(String attributeName,
+ String attrValue,
+ String soapEnvelopeNamespaceURI) {
+ OMAttribute omAttribute = this.getAttribute(
+ new QName(soapEnvelopeNamespaceURI, attributeName));
+ if (omAttribute != null) {
+ omAttribute.setAttributeValue(attrValue);
+ } else {
+ OMAttribute attribute = new AttrImpl(this.ownerNode, attributeName,
+ new NamespaceImpl(soapEnvelopeNamespaceURI,
+ SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX,
+ this.factory), attrValue, this.factory);
+ this.addAttribute(attribute);
+ }
+ }
+
+ /**
+ * Method getAttribute.
+ *
+ * @param attrName
+ * @return Returns String.
+ */
+ protected String getAttribute(String attrName,
+ String soapEnvelopeNamespaceURI) {
+ OMAttribute omAttribute = this.getAttribute(
+ new QName(soapEnvelopeNamespaceURI, attrName));
+ return (omAttribute != null)
+ ? omAttribute.getAttributeValue()
+ : null;
+ }
+
+ public boolean isProcessed() {
+ return processed;
+ }
+
+ public void setProcessed() {
+ processed = true;
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPHeaderImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,249 @@
+/*
+ * 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.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.dom.ElementImpl;
+import org.apache.axiom.soap.SOAPConstants;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+public abstract class SOAPHeaderImpl extends SOAPElement implements SOAPHeader {
+
+
+ /**
+ * @param envelope
+ */
+ public SOAPHeaderImpl(SOAPEnvelope envelope, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(envelope, SOAPConstants.HEADER_LOCAL_NAME, true, factory);
+
+ }
+
+ /**
+ * Constructor SOAPHeaderImpl
+ *
+ * @param envelope
+ * @param builder
+ */
+ public SOAPHeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(envelope, SOAPConstants.HEADER_LOCAL_NAME, builder, factory);
+ }
+
+ /**
+ * Creates a new <CODE>SOAPHeaderBlock</CODE> object initialized with the
+ * specified name and adds it to this <CODE>SOAPHeader</CODE> object.
+ *
+ * @param localName
+ * @param ns
+ * @return the new <CODE>SOAPHeaderBlock</CODE> object that was inserted
+ * into this <CODE>SOAPHeader</CODE> object
+ * @throws org.apache.axiom.om.OMException
+ * if a SOAP error occurs
+ * @throws OMException
+ */
+ public abstract SOAPHeaderBlock addHeaderBlock(String localName,
+ OMNamespace ns)
+ throws OMException;
+
+ /**
+ * Returns a list of all the <CODE>SOAPHeaderBlock</CODE> objects in this
+ * <CODE>SOAPHeader</CODE> object that have the the specified actor. An
+ * actor is a global attribute that indicates the intermediate parties to
+ * whom the message should be sent. An actor receives the message and then
+ * sends it to the next actor. The default actor is the ultimate intended
+ * recipient for the message, so if no actor attribute is included in a
+ * <CODE>SOAPHeader</CODE> object, the message is sent to its ultimate
+ * destination.
+ *
+ * @param paramRole a <CODE>String</CODE> giving the URI of the actor for
+ * which to search
+ * @return an <CODE>Iterator</CODE> object over all the <CODE>
+ * SOAPHeaderBlock</CODE> objects that contain the specified actor
+ * @see #extractHeaderBlocks(String) extractHeaderBlocks(java.lang.String)
+ */
+ public Iterator examineHeaderBlocks(String paramRole) {
+ /* Iterator headerBlocksIter = this.getChildren();
+ ArrayList headersWithGivenActor = new ArrayList();
+
+ if (paramRole == null || "".equals(paramRole)) {
+ return returnAllSOAPHeaders(this.getChildren());
+ }
+
+ while (headerBlocksIter.hasNext()) {
+ Object o = headerBlocksIter.next();
+ if (o instanceof SOAPHeaderBlock) {
+ SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) o;
+ String role = soapHeaderBlock.getRole();
+ if ((role != null) && role.equalsIgnoreCase(paramRole)) {
+ headersWithGivenActor.add(soapHeaderBlock);
+ }
+ }
+ }
+ return headersWithGivenActor.iterator();*/
+
+ if (paramRole == null || paramRole.trim().length() == 0) {
+ return examineAllHeaderBlocks();
+ }
+ Collection elements = new ArrayList();
+ for (Iterator iter = examineAllHeaderBlocks(); iter.hasNext();) {
+ SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) iter.next();
+ if (headerBlock.getRole() == null ||
+ headerBlock.getRole().trim().length() == 0 ||
+ headerBlock.getRole().equals(paramRole)) {
+ elements.add(headerBlock);
+ }
+ }
+ return elements.iterator();
+ }
+
+ private Iterator returnAllSOAPHeaders(Iterator children) {
+ ArrayList headers = new ArrayList();
+ while (children.hasNext()) {
+ Object o = children.next();
+ if (o instanceof SOAPHeaderBlock) {
+ headers.add(o);
+ }
+ }
+
+ return headers.iterator();
+
+ }
+
+ /**
+ * Returns a list of all the <CODE>SOAPHeaderBlock</CODE> objects in this
+ * <CODE>SOAPHeader</CODE> object that have the the specified role and
+ * detaches them from this <CODE> SOAPHeader</CODE> object. <P>This method
+ * allows an role to process only the parts of the <CODE>SOAPHeader</CODE>
+ * object that apply to it and to remove them before passing the message on
+ * to the next role.
+ *
+ * @param role a <CODE>String</CODE> giving the URI of the role for which to
+ * search
+ * @return an <CODE>Iterator</CODE> object over all the <CODE>
+ * SOAPHeaderBlock</CODE> objects that contain the specified role
+ * @see #examineHeaderBlocks(String) examineHeaderBlocks(java.lang.String)
+ */
+ public abstract Iterator extractHeaderBlocks(String role);
+
+ /**
+ * Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
+ * objects in this <code>SOAPHeader</code> object that have the specified
+ * actor and that have a MustUnderstand attribute whose value is equivalent
+ * to <code>true</code>.
+ *
+ * @param actor a <code>String</code> giving the URI of the actor for which
+ * to search
+ * @return an <code>Iterator</code> object over all the
+ * <code>SOAPHeaderBlock</code> objects that contain the specified
+ * actor and are marked as MustUnderstand
+ */
+ 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>
+ * objects in this <code>SOAPHeader</code> object. Not that this will return
+ * elements containing the QName (http://schemas.xmlsoap.org/soap/envelope/,
+ * Header)
+ *
+ * @return an <code>Iterator</code> object over all the
+ * <code>SOAPHeaderBlock</code> objects contained by this
+ * <code>SOAPHeader</code>
+ */
+ public Iterator examineAllHeaderBlocks() {
+ return this.getChildrenWithName(null);
+ }
+
+ /**
+ * Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
+ * objects in this <code>SOAPHeader </code> object and detaches them from
+ * this <code>SOAPHeader</code> object.
+ *
+ * @return an <code>Iterator</code> object over all the
+ * <code>SOAPHeaderBlock</code> objects contained by this
+ * <code>SOAPHeader</code>
+ */
+ public Iterator extractAllHeaderBlocks() {
+ Collection result = new ArrayList();
+ for (Iterator iter = getChildrenWithName(null); iter.hasNext();) {
+ result.add(((ElementImpl) iter.next()).detach());
+ }
+ return result.iterator();
+ }
+
+ public ArrayList getHeaderBlocksWithNSURI(String nsURI) {
+ ArrayList headers = null;
+ OMNode node = null;
+ OMElement header = this.getFirstElement();
+
+ if (header != null) {
+ headers = new ArrayList();
+ }
+
+ node = header;
+
+ while (node != null) {
+ if (node.getType() == OMNode.ELEMENT_NODE) {
+ header = (OMElement) node;
+ if (nsURI.equals(header.getNamespace().getName())) {
+ headers.add(header);
+ }
+ }
+ node = node.getNextOMSibling();
+
+ }
+ return headers;
+
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAPEnvelopeImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting an implementation of SOAP Envelope as the " +
+ "parent. But received some other implementation");
+ }
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,65 @@
+/*
+ * 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.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.OMNodeEx;
+import org.apache.axiom.om.impl.OMOutputImpl;
+import org.apache.axiom.om.impl.dom.DocumentImpl;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPMessage;
+import org.apache.axiom.soap.SOAPProcessingException;
+
+import javax.xml.stream.XMLStreamException;
+
+public class SOAPMessageImpl extends DocumentImpl implements SOAPMessage {
+
+ public SOAPMessageImpl(SOAPFactory factory) {
+ super(factory);
+ }
+
+ public SOAPMessageImpl(SOAPEnvelope envelope,
+ OMXMLParserWrapper parserWrapper, SOAPFactory factory) {
+ this(parserWrapper, factory);
+ this.setSOAPEnvelope(envelope);
+ }
+
+ public SOAPMessageImpl(OMXMLParserWrapper parserWrapper, SOAPFactory factory) {
+ super(factory);
+ this.builder = parserWrapper;
+ }
+
+
+ public SOAPEnvelope getSOAPEnvelope() throws SOAPProcessingException {
+ return (SOAPEnvelope) getOMDocumentElement();
+ }
+
+ public void setSOAPEnvelope(SOAPEnvelope envelope)
+ throws SOAPProcessingException {
+ this.addChild(envelope);
+ }
+
+ protected void serialize(OMOutputImpl omOutput, boolean cache,
+ boolean includeXMLDeclaration) throws XMLStreamException {
+ if (cache) {
+ ((OMNodeEx)this.ownerNode.getDocumentElement()).serialize(omOutput);
+ } else {
+ ((OMNodeEx)this.ownerNode.getDocumentElement()).serializeAndConsume(omOutput);
+ }
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPTextImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPTextImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPTextImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,49 @@
+/*
+ * 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.axiom.soap.impl.dom;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPProcessingException;
+
+public class SOAPTextImpl extends SOAPElement{
+
+ protected SOAPTextImpl(OMElement parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME, true, factory);
+ }
+
+ protected SOAPTextImpl(OMElement parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, SOAP12Constants.SOAP_FAULT_TEXT_LOCAL_NAME, builder, factory);
+ }
+
+ public void setLang(String lang) {
+ // TODO : Chinthaka fix me
+ }
+
+ public String getLang() {
+ // TODO Chinthaka fix me
+ return null;
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ // do nothing
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/factory/DOMSOAPFactory.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,267 @@
+/*
+ * 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.axiom.soap.impl.dom.factory;
+
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.dom.DocumentImpl;
+import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultDetail;
+import org.apache.axiom.soap.SOAPFaultNode;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.soap.SOAPFaultRole;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPMessage;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
+import org.apache.axiom.soap.impl.dom.SOAPMessageImpl;
+import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultDetailImpl;
+
+public class DOMSOAPFactory extends OMDOMFactory implements SOAPFactory {
+
+ public DOMSOAPFactory() {}
+
+ public DOMSOAPFactory(DocumentImpl doc) {
+ super(doc);
+ }
+
+ public String getSoapVersionURI() {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
+ SOAPMessageImpl messageImpl = new SOAPMessageImpl(builder, this);
+ this.document = messageImpl;
+ return messageImpl;
+ }
+
+ public SOAPMessage createSOAPMessage(SOAPEnvelope envelope, OMXMLParserWrapper parserWrapper) {
+ SOAPMessageImpl messageImpl = new SOAPMessageImpl(envelope, parserWrapper, this);
+ this.document = messageImpl;
+ return messageImpl;
+ }
+
+ public SOAPEnvelope createSOAPEnvelope(OMXMLParserWrapper builder) {
+ return new SOAPEnvelopeImpl((DocumentImpl)this.createOMDocument(), builder, this);
+ }
+
+ public SOAPEnvelope createSOAPEnvelope() throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, SOAPHeader parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, SOAPHeader parent, OMXMLParserWrapper builder) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent, Exception e) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultCode createSOAPFaultCode(SOAPFault parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultCode createSOAPFaultCode(SOAPFault parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultCode parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultCode parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultSubCode parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultSubCode parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultCode parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultCode parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultSubCode parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultSubCode parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultReason createSOAPFaultReason(SOAPFault parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultReason createSOAPFaultReason(SOAPFault parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultText createSOAPFaultText(SOAPFaultReason parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultText createSOAPFaultText(SOAPFaultReason parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultNode createSOAPFaultNode(SOAPFault parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultNode createSOAPFaultNode(SOAPFault parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultRole createSOAPFaultRole(SOAPFault parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultRole createSOAPFaultRole(SOAPFault parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultDetail createSOAPFaultDetail(SOAPFault parent) throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPFaultDetail createSOAPFaultDetail(SOAPFault parent, OMXMLParserWrapper builder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException {
+ SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
+ SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());
+
+ SOAPFaultCode faultCode = createSOAPFaultCode(fault);
+ createSOAPFaultValue(faultCode);
+
+ SOAPFaultReason reason = createSOAPFaultReason(fault);
+ createSOAPFaultText(reason);
+
+ createSOAPFaultNode(fault);
+ createSOAPFaultRole(fault);
+ createSOAPFaultDetail(fault);
+
+ return defaultEnvelope;
+ }
+
+ public SOAPMessage createSOAPMessage() {
+ return new SOAPMessageImpl(this);
+ }
+
+ public SOAPHeader createSOAPHeader() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns) throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFault createSOAPFault() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPBody createSOAPBody() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultCode createSOAPFaultCode() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultValue createSOAPFaultValue() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultReason createSOAPFaultReason() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultText createSOAPFaultText() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultNode createSOAPFaultNode() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultRole createSOAPFaultRole() throws SOAPProcessingException {
+ throw new UnsupportedOperationException("TODO");
+ }
+
+ public SOAPFaultDetail createSOAPFaultDetail() throws SOAPProcessingException {
+ return new SOAP11FaultDetailImpl(this);
+ }
+
+ public OMNamespace getNamespace() {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11BodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11BodyImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11BodyImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11BodyImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,52 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPBodyImpl;
+
+public class SOAP11BodyImpl extends SOAPBodyImpl {
+ /**
+ * @param envelope
+ */
+ public SOAP11BodyImpl(SOAPEnvelope envelope, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(envelope, factory);
+ }
+
+ /**
+ * Constructor SOAPBodyImpl
+ *
+ * @param envelope
+ * @param builder
+ */
+ public SOAP11BodyImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(envelope, builder, factory);
+ }
+
+ public SOAPFault addFault(Exception e) throws OMException {
+ SOAPFault soapFault = new SOAP11FaultImpl(this, e, (SOAPFactory)this.factory);
+ this.hasSOAPFault = true;
+ return soapFault;
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,230 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.dom.DocumentImpl;
+import org.apache.axiom.om.impl.dom.NamespaceImpl;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultDetail;
+import org.apache.axiom.soap.SOAPFaultNode;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.soap.SOAPFaultRole;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
+import org.apache.axiom.soap.impl.dom.factory.DOMSOAPFactory;
+
+public class SOAP11Factory extends DOMSOAPFactory {
+
+ public SOAP11Factory() {}
+
+ public SOAP11Factory(DocumentImpl doc) {
+ super(doc);
+ }
+
+ public String getSoapVersionURI() {
+ return SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+ }
+
+ public SOAPEnvelope createSOAPEnvelope() {
+ return new SOAPEnvelopeImpl(
+ new NamespaceImpl(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX, this),
+ this);
+ }
+
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope)
+ throws SOAPProcessingException {
+ return new SOAP11HeaderImpl(envelope, this);
+ }
+
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope,
+ OMXMLParserWrapper builder) {
+ return new SOAP11HeaderImpl(envelope, builder, this);
+ }
+
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+ OMNamespace ns, SOAPHeader parent) throws SOAPProcessingException {
+ return new SOAP11HeaderBlockImpl(localName, ns, parent, this);
+ }
+
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+ OMNamespace ns, SOAPHeader parent, OMXMLParserWrapper builder)
+ throws SOAPProcessingException {
+ return new SOAP11HeaderBlockImpl(localName, ns, parent, builder, this);
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent, Exception e)
+ throws SOAPProcessingException {
+ return new SOAP11FaultImpl(parent, e, this);
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultImpl(parent, this);
+ }
+
+ public SOAPFault createSOAPFault(SOAPBody parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultImpl(parent, builder, this);
+ }
+
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope)
+ throws SOAPProcessingException {
+ return new SOAP11BodyImpl(envelope, (SOAPFactory) envelope
+ .getOMFactory());
+ }
+
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope,
+ OMXMLParserWrapper builder) {
+ return new SOAP11BodyImpl(envelope, builder, (SOAPFactory) envelope
+ .getOMFactory());
+ }
+
+ public SOAPFaultCode createSOAPFaultCode(SOAPFault parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultCodeImpl(parent, this);
+ }
+
+ public SOAPFaultCode createSOAPFaultCode(SOAPFault parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultCodeImpl(parent, builder, this);
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultCode parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultValueImpl(parent, this);
+ }
+
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultCode parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultValueImpl(parent, builder, this);
+ }
+
+ //added
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultSubCode parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultValueImpl(parent, this);
+ }
+
+ //added
+ public SOAPFaultValue createSOAPFaultValue(SOAPFaultSubCode parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultValueImpl(parent, builder, this);
+ }
+
+ //changed
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultCode parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultSubCodeImpl(parent, this);
+ }
+
+ //changed
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultCode parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultSubCodeImpl(parent, builder, this);
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultSubCode parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultSubCodeImpl(parent, this);
+ }
+
+ public SOAPFaultSubCode createSOAPFaultSubCode(SOAPFaultSubCode parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultSubCodeImpl(parent, builder, this);
+ }
+
+ public SOAPFaultReason createSOAPFaultReason(SOAPFault parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultReasonImpl(parent, this);
+ }
+
+ public SOAPFaultReason createSOAPFaultReason(SOAPFault parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultReasonImpl(parent, builder, this);
+ }
+
+ public SOAPFaultText createSOAPFaultText(SOAPFaultReason parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultTextImpl(parent, this);
+ }
+
+ public SOAPFaultText createSOAPFaultText(SOAPFaultReason parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultTextImpl(parent, builder, this);
+ }
+
+ public SOAPFaultNode createSOAPFaultNode(SOAPFault parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultNodeImpl(parent, this);
+ }
+
+ public SOAPFaultNode createSOAPFaultNode(SOAPFault parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultNodeImpl(parent, builder, this);
+ }
+
+ public SOAPFaultRole createSOAPFaultRole(SOAPFault parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultRoleImpl(parent, this);
+ }
+
+ public SOAPFaultRole createSOAPFaultRole(SOAPFault parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultRoleImpl(parent, builder, this);
+ }
+
+ public SOAPFaultDetail createSOAPFaultDetail(SOAPFault parent)
+ throws SOAPProcessingException {
+ return new SOAP11FaultDetailImpl(parent, this);
+ }
+
+ public SOAPFaultDetail createSOAPFaultDetail(SOAPFault parent,
+ OMXMLParserWrapper builder) {
+ return new SOAP11FaultDetailImpl(parent, builder, this);
+ }
+
+ public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
+ OMNamespace ns =
+ new NamespaceImpl(
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX, this);
+ SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
+ createSOAPHeader(env);
+ createSOAPBody(env);
+ return env;
+ }
+
+ public OMNamespace getNamespace() {
+ return new NamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX, this);
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java Mon Mar 27 00:02:06 2006
@@ -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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.llom.OMSerializerUtil;
+import org.apache.axiom.om.impl.serialize.StreamWriterToContentHandlerConverter;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultCodeImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class SOAP11FaultCodeImpl extends SOAPFaultCodeImpl {
+ /**
+ * Constructor OMElementImpl
+ *
+ * @param parent
+ * @param builder
+ */
+ public SOAP11FaultCodeImpl(SOAPFault parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ /**
+ * @param parent
+ */
+ public SOAP11FaultCodeImpl(SOAPFault parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, false, factory);
+ }
+
+
+ public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException {
+ if (!(subCode instanceof SOAP11FaultSubCodeImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Sub " +
+ "Code. But received some other implementation");
+ }
+ super.setSubCode(subCode);
+ }
+
+ public void setValue(SOAPFaultValue value) throws SOAPProcessingException {
+ if (!(value instanceof SOAP11FaultValueImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Value. " +
+ "But received some other implementation");
+ }
+ super.setValue(value);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault as the " +
+ "parent. But received some other implementation");
+ }
+ }
+
+ protected void serialize(
+ org.apache.axiom.om.impl.OMOutputImpl omOutput, boolean cache)
+ throws XMLStreamException {
+
+ // select the builder
+ short builderType = PULL_TYPE_BUILDER; // default is pull type
+ if (builder != null) {
+ builderType = this.builder.getBuilderType();
+ }
+ if ((builderType == PUSH_TYPE_BUILDER)
+ && (builder.getRegisteredContentHandler() == null)) {
+ builder.registerExternalContentHandler(
+ new StreamWriterToContentHandlerConverter(omOutput));
+ }
+
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ if (this.getNamespace() != null) {
+ String prefix = this.getNamespace().getPrefix();
+ String nameSpaceName = this.getNamespace().getName();
+ writer.writeStartElement(prefix, SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME,
+ nameSpaceName);
+ } else {
+ writer.writeStartElement(
+ SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME);
+ }
+
+ OMSerializerUtil.serializeAttributes(this, omOutput);
+ OMSerializerUtil.serializeNamespaces(this, omOutput);
+
+
+ String text = this.getValue().getText();
+ writer.writeCharacters(text);
+ writer.writeEndElement();
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultDetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultDetailImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultDetailImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultDetailImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,95 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.OMOutputImpl;
+import org.apache.axiom.om.impl.llom.OMSerializerUtil;
+import org.apache.axiom.om.impl.serialize.StreamWriterToContentHandlerConverter;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultDetailImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class SOAP11FaultDetailImpl extends SOAPFaultDetailImpl {
+
+ public SOAP11FaultDetailImpl(SOAPFault parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, false, factory);
+ }
+
+ public SOAP11FaultDetailImpl(SOAPFault parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ public SOAP11FaultDetailImpl(SOAPFactory factory) {
+ super(factory);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault as " +
+ "the parent. But received some other implementation");
+ }
+ }
+
+ public void serialize(OMOutputImpl omOutput, boolean cache)
+ throws XMLStreamException {
+
+ // select the builder
+ short builderType = PULL_TYPE_BUILDER; // default is pull type
+ if (builder != null) {
+ builderType = this.builder.getBuilderType();
+ }
+ if ((builderType == PUSH_TYPE_BUILDER)
+ && (builder.getRegisteredContentHandler() == null)) {
+ builder.registerExternalContentHandler(
+ new StreamWriterToContentHandlerConverter(omOutput));
+ }
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ if (this.getNamespace() != null) {
+ String prefix = this.getNamespace().getPrefix();
+ String nameSpaceName = this.getNamespace().getName();
+ writer.writeStartElement(prefix, SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME,
+ nameSpaceName);
+ } else {
+ writer.writeStartElement(
+ SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+ }
+ OMSerializerUtil.serializeAttributes(this, omOutput);
+ OMSerializerUtil.serializeNamespaces(this, omOutput);
+
+
+ String text = this.getText();
+ writer.writeCharacters(text);
+
+
+ if (firstChild != null) {
+ firstChild.serializeAndConsume(omOutput);
+ }
+ writer.writeEndElement();
+ }
+
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,138 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultDetail;
+import org.apache.axiom.soap.SOAPFaultNode;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.soap.SOAPFaultRole;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultImpl;
+
+import javax.xml.stream.XMLStreamException;
+
+public class SOAP11FaultImpl extends SOAPFaultImpl {
+
+ public SOAP11FaultImpl(SOAPBody parent, Exception e, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, e, factory);
+ }
+
+ public SOAP11FaultImpl(SOAPBody parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ /**
+ * This is a convenience method for the SOAP Fault Impl.
+ *
+ * @param parent
+ */
+ public SOAP11FaultImpl(SOAPBody parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, factory);
+ }
+
+ protected SOAPFaultDetail getNewSOAPFaultDetail(SOAPFault fault)
+ throws SOAPProcessingException {
+ return new SOAP11FaultDetailImpl(fault, (SOAPFactory)this.factory);
+ }
+
+ public void serialize(org.apache.axiom.om.impl.OMOutputImpl omOutput)
+ throws XMLStreamException {
+ super.serialize(omOutput);
+ }
+
+ public void serializeAndConsume(
+ org.apache.axiom.om.impl.OMOutputImpl omOutput)
+ throws XMLStreamException {
+ super.serializeAndConsume(omOutput);
+ }
+
+ public void setCode(SOAPFaultCode soapFaultCode)
+ throws SOAPProcessingException {
+ if (!(soapFaultCode instanceof SOAP11FaultCodeImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Code. " +
+ "But received some other implementation");
+ }
+ super.setCode(soapFaultCode);
+ }
+
+ public void setReason(SOAPFaultReason reason) throws SOAPProcessingException {
+ if (!(reason instanceof SOAP11FaultReasonImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Reason. " +
+ "But received some other implementation");
+ }
+ super.setReason(reason);
+ }
+
+ public void setNode(SOAPFaultNode node) throws SOAPProcessingException {
+ if (!(node instanceof SOAP11FaultNodeImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Node. " +
+ "But received some other implementation");
+ }
+ super.setNode(node);
+ }
+
+ public void setRole(SOAPFaultRole role) throws SOAPProcessingException {
+ if (!(role instanceof SOAP11FaultRoleImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Role. " +
+ "But received some other implementation");
+ }
+ super.setRole(role);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ 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);
+ }
+
+ protected void serializeFaultNode(
+ org.apache.axiom.om.impl.OMOutputImpl omOutput)
+ throws XMLStreamException {
+
+ }
+
+ public SOAPFaultRole getRole() {
+ return (SOAP11FaultRoleImpl) this
+ .getChildWithName(SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME);
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultNodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultNodeImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultNodeImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultNodeImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultNodeImpl;
+
+public class SOAP11FaultNodeImpl extends SOAPFaultNodeImpl {
+
+ public SOAP11FaultNodeImpl(SOAPFault parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, factory);
+ }
+
+ public SOAP11FaultNodeImpl(SOAPFault parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault as the " +
+ "parent. But received some other implementation");
+ }
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultReasonImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultReasonImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultReasonImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultReasonImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,99 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.OMOutputImpl;
+import org.apache.axiom.om.impl.llom.OMSerializerUtil;
+import org.apache.axiom.om.impl.serialize.StreamWriterToContentHandlerConverter;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultText;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultReasonImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class SOAP11FaultReasonImpl extends SOAPFaultReasonImpl {
+
+ public SOAP11FaultReasonImpl(SOAPFault parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ /**
+ * @param parent
+ */
+ public SOAP11FaultReasonImpl(SOAPFault parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, false, factory);
+ }
+
+ public void setSOAPText(SOAPFaultText soapFaultText)
+ throws SOAPProcessingException {
+ if (!(soapFaultText instanceof SOAP11FaultTextImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Text. " +
+ "But received some other implementation");
+ }
+ super.setSOAPText(soapFaultText);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault as the " +
+ "parent. But received some other implementation");
+ }
+ }
+
+ protected void serialize(OMOutputImpl omOutput, boolean cache)
+ throws XMLStreamException {
+
+ // select the builder
+ short builderType = PULL_TYPE_BUILDER; // default is pull type
+ if (builder != null) {
+ builderType = this.builder.getBuilderType();
+ }
+ if ((builderType == PUSH_TYPE_BUILDER)
+ && (builder.getRegisteredContentHandler() == null)) {
+ builder.registerExternalContentHandler(
+ new StreamWriterToContentHandlerConverter(omOutput));
+ }
+
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ if (this.getNamespace() != null) {
+ String prefix = this.getNamespace().getPrefix();
+ String nameSpaceName = this.getNamespace().getName();
+ writer.writeStartElement(prefix, SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME,
+ nameSpaceName);
+ } else {
+ writer.writeStartElement(
+ SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME);
+ }
+ OMSerializerUtil.serializeAttributes(this, omOutput);
+ OMSerializerUtil.serializeNamespaces(this, omOutput);
+
+ String text = this.getSOAPText().getText();
+ writer.writeCharacters(text);
+ writer.writeEndElement();
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultRoleImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultRoleImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultRoleImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultRoleImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,86 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.OMOutputImpl;
+import org.apache.axiom.om.impl.llom.OMSerializerUtil;
+import org.apache.axiom.om.impl.serialize.StreamWriterToContentHandlerConverter;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultRoleImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class SOAP11FaultRoleImpl extends SOAPFaultRoleImpl {
+
+ public SOAP11FaultRoleImpl(SOAPFault parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME, false,
+ factory);
+ }
+
+ public SOAP11FaultRoleImpl(SOAPFault parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault as the " +
+ "parent. But received some other implementation");
+ }
+ }
+
+ protected void serialize(OMOutputImpl omOutput, boolean cache)
+ throws XMLStreamException {
+
+ // select the builder
+ short builderType = PULL_TYPE_BUILDER; // default is pull type
+ if (builder != null) {
+ builderType = this.builder.getBuilderType();
+ }
+ if ((builderType == PUSH_TYPE_BUILDER)
+ && (builder.getRegisteredContentHandler() == null)) {
+ builder.registerExternalContentHandler(
+ new StreamWriterToContentHandlerConverter(omOutput));
+ }
+
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ if (this.getNamespace() != null) {
+ String prefix = this.getNamespace().getPrefix();
+ String nameSpaceName = this.getNamespace().getName();
+ writer.writeStartElement(prefix, SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME,
+ nameSpaceName);
+ } else {
+ writer.writeStartElement(
+ SOAP11Constants.SOAP_FAULT_ACTOR_LOCAL_NAME);
+ }
+ OMSerializerUtil.serializeAttributes(this, omOutput);
+ OMSerializerUtil.serializeNamespaces(this, omOutput);
+
+ String text = this.getText();
+ writer.writeCharacters(text);
+ writer.writeEndElement();
+ }
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultSubCodeImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,88 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultValue;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultSubCodeImpl;
+
+public class SOAP11FaultSubCodeImpl extends SOAPFaultSubCodeImpl {
+
+ //changed
+ public SOAP11FaultSubCodeImpl(SOAPFaultCode parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, factory);
+ }
+
+ //changed
+ public SOAP11FaultSubCodeImpl(SOAPFaultCode parent,
+ OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder,
+ factory);
+ }
+
+ public SOAP11FaultSubCodeImpl(SOAPFaultSubCode parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, factory);
+ }
+
+ public SOAP11FaultSubCodeImpl(SOAPFaultSubCode parent,
+ OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder,
+ factory);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultSubCodeImpl) ||
+ (parent instanceof SOAP11FaultCodeImpl)) {
+ throw new SOAPProcessingException("Expecting SOAP 1.1 " +
+ "implementation of SOAP FaultSubCode or SOAP FaultCode as" +
+ " the parent. But received some other implementation");
+ }
+ }
+
+ public void setSubCode(SOAPFaultSubCode subCode)
+ throws SOAPProcessingException {
+ if (!((parentNode instanceof SOAP11FaultSubCodeImpl) ||
+ (parentNode instanceof SOAP11FaultCodeImpl))) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Sub " +
+ "Code. But received some other implementation");
+ }
+ super.setSubCode(subCode);
+ }
+
+ public void setValue(SOAPFaultValue soapFaultSubCodeValue)
+ throws SOAPProcessingException {
+ if (!(soapFaultSubCodeValue instanceof SOAP11FaultValueImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Fault Value. " +
+ "But received some other implementation");
+ }
+ super.setValue(soapFaultSubCodeValue);
+ }
+
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultTextImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultTextImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultTextImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,44 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFaultReason;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultTextImpl;
+
+public class SOAP11FaultTextImpl extends SOAPFaultTextImpl {
+ public SOAP11FaultTextImpl(SOAPFaultReason parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, factory);
+ }
+
+ public SOAP11FaultTextImpl(SOAPFaultReason parent,
+ OMXMLParserWrapper builder, SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11FaultReasonImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP FaultReason " +
+ "as the parent. But received some other implementation");
+ }
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultValueImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultValueImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultValueImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultValueImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,48 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPFaultValueImpl;
+
+public class SOAP11FaultValueImpl extends SOAPFaultValueImpl {
+
+ public SOAP11FaultValueImpl(OMElement parent, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(parent, factory);
+ }
+
+ public SOAP11FaultValueImpl(OMElement parent, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(parent, builder, factory);
+ }
+
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!((parent instanceof SOAP11FaultSubCodeImpl) ||
+ (parent instanceof SOAP11FaultCodeImpl))) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP FaultSubCode " +
+ "or SOAP FaultCode as the parent. But received some other" +
+ " implementation." +
+ parent.getClass());
+ }
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderBlockImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderBlockImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderBlockImpl.java Mon Mar 27 00:02:06 2006
@@ -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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPConstants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPHeaderBlockImpl;
+
+public class SOAP11HeaderBlockImpl extends SOAPHeaderBlockImpl {
+ /**
+ * @param localName
+ * @param ns
+ */
+ public SOAP11HeaderBlockImpl(String localName,
+ OMNamespace ns,
+ SOAPHeader parent,
+ SOAPFactory factory) throws SOAPProcessingException {
+ super(localName, ns, parent, factory);
+ checkParent(parent);
+ }
+
+ /**
+ * Constructor SOAPHeaderBlockImpl
+ *
+ * @param localName
+ * @param ns
+ * @param parent
+ * @param builder
+ */
+ public SOAP11HeaderBlockImpl(String localName,
+ OMNamespace ns,
+ OMElement parent,
+ OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(localName, ns, parent, builder, factory);
+ }
+
+
+ protected void checkParent(OMElement parent) throws SOAPProcessingException {
+ if (!(parent instanceof SOAP11HeaderImpl)) {
+ throw new SOAPProcessingException(
+ "Expecting SOAP 1.1 implementation of SOAP Body as the parent. But received some other implementation");
+ }
+ }
+
+ public void setRole(String roleURI) {
+ setAttribute(SOAP11Constants.ATTR_ACTOR,
+ roleURI,
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+
+ }
+
+ public String getRole() {
+ return getAttribute(SOAP11Constants.ATTR_ACTOR,
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ public void setMustUnderstand(boolean mustUnderstand) {
+ setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND,
+ mustUnderstand ? "1" : "0",
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ }
+
+ 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 {
+ 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.
+ *
+ * @return <CODE>true</CODE> if the mustUnderstand attribute of
+ * this <CODE>SOAPHeaderBlock</CODE> object is turned on;
+ * <CODE>false</CODE> otherwise
+ */
+ public boolean getMustUnderstand() throws SOAPProcessingException {
+ String mustUnderstand = "";
+ if ((mustUnderstand =
+ getAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND,
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI))
+ != null) {
+ 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;
+
+ }
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11HeaderImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,89 @@
+/*
+ * 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.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.OMNodeEx;
+import org.apache.axiom.om.impl.traverse.OMChildrenWithSpecificAttributeIterator;
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPHeaderImpl;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+
+public class SOAP11HeaderImpl extends SOAPHeaderImpl {
+
+
+ /**
+ * @param envelope
+ */
+ public SOAP11HeaderImpl(SOAPEnvelope envelope, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(envelope, factory);
+ }
+
+ /**
+ * Constructor SOAPHeaderImpl
+ *
+ * @param envelope
+ * @param builder
+ */
+ public SOAP11HeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(envelope, builder, factory);
+ }
+
+ public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns)
+ throws OMException {
+ if (ns == null || ns.getName() == null || "".equals(ns.getName())) {
+ throw new OMException(
+ "All the SOAP Header blocks should be namespace qualified");
+ }
+
+ OMNamespace namespace = findNamespace(ns.getName(), ns.getPrefix());
+ if (namespace != null) {
+ ns = namespace;
+ }
+
+ SOAPHeaderBlock soapHeaderBlock = null;
+ try {
+ soapHeaderBlock = new SOAP11HeaderBlockImpl(localName, ns, this,
+ (SOAPFactory)this.factory);
+ } catch (SOAPProcessingException e) {
+ throw new OMException(e);
+ }
+ ((OMNodeEx)soapHeaderBlock).setComplete(true);
+ return soapHeaderBlock;
+ }
+
+ public Iterator extractHeaderBlocks(String role) {
+ return new OMChildrenWithSpecificAttributeIterator(getFirstOMChild(),
+ new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+ SOAP11Constants.ATTR_ACTOR),
+ role,
+ true);
+
+ }
+
+
+}
Added: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap12/SOAP12BodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap12/SOAP12BodyImpl.java?rev=389047&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap12/SOAP12BodyImpl.java (added)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap12/SOAP12BodyImpl.java Mon Mar 27 00:02:06 2006
@@ -0,0 +1,53 @@
+/*
+ * 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.axiom.soap.impl.dom.soap12;
+
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.soap.impl.dom.SOAPBodyImpl;
+
+public class SOAP12BodyImpl extends SOAPBodyImpl {
+ /**
+ * @param envelope
+ */
+ public SOAP12BodyImpl(SOAPEnvelope envelope, SOAPFactory factory)
+ throws SOAPProcessingException {
+ super(envelope, factory);
+ }
+
+ /**
+ * Constructor SOAPBodyImpl
+ *
+ * @param envelope
+ * @param builder
+ */
+ public SOAP12BodyImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder,
+ SOAPFactory factory) {
+ super(envelope, builder, factory);
+ }
+
+ public SOAPFault addFault(Exception e) throws OMException {
+ SOAPFault soapFault = new SOAP12FaultImpl(this, e,
+ (SOAPFactory) this.factory);
+ this.hasSOAPFault = true;
+ return soapFault;
+ }
+}