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 ia...@apache.org on 2004/01/02 17:25:13 UTC

cvs commit: ws-axis/java/src/org/apache/axis SOAPPart.java

ias         2004/01/02 08:25:13

  Modified:    java/src/org/apache/axis SOAPPart.java
  Log:
  Fix for Bug 22981 - The SAAJ 1.2 Preliminary Upgrade
  
  Thanks to Dr. Ahn, Heejune. 
  
  Note:
  -This change passed all-tests.
  
  Revision  Changes    Path
  1.61      +186 -80   ws-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- SOAPPart.java	1 Dec 2003 17:57:31 -0000	1.60
  +++ SOAPPart.java	2 Jan 2004 16:25:13 -0000	1.61
  @@ -60,6 +60,7 @@
   import org.apache.axis.encoding.DeserializationContextImpl;
   import org.apache.axis.encoding.SerializationContextImpl;
   import org.apache.axis.message.InputStreamBody;
  +import org.apache.axis.message.SOAPDocumentImpl;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeaderElement;
   import org.apache.axis.message.MimeHeaders;
  @@ -116,6 +117,7 @@
    * @author Rob Jellinghaus (robj@unrealities.com)
    * @author Doug Davis (dug@us.ibm.com)
    * @author Glen Daniels (gdaniels@allaire.com)
  + * @author Heejune Ahn (cityboy@tmax.co.kr)
    */
   public class SOAPPart extends javax.xml.soap.SOAPPart implements Part
   {
  @@ -870,172 +872,276 @@
           }
       }
   
  -    public DOMImplementation getImplementation() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     *  Implementation of org.w3c.Document
  +     *  Most of methods will be implemented using the delgate
  +     *  instance of SOAPDocumentImpl
  +     *  This is for two reasons:
  +     *  - possible change of message classes, by extenstion of xerces implementation
  +     *  - we cannot extends SOAPPart (multiple inheritance),
  +     *    since it is defined as Abstract class
  +     * ***********************************************************
  +     */
  +
  +    private Document document = new SOAPDocumentImpl(this);
  +    /**
  +     *  @since SAAJ 1.2
  +     */
  +    public Document getSOAPDocument(){
  +        if(document == null){
  +            document = new SOAPDocumentImpl(this);
  +        }
  +        return document;
       }
   
  -    public DocumentFragment createDocumentFragment() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     * @return
  +     */
  +    public DocumentType getDoctype(){
  +        return document.getDoctype();
       }
   
  -    public DocumentType getDoctype() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     * @return
  +     */
  +    public DOMImplementation getImplementation(){
  +        return document.getImplementation();
       }
   
  -    public Element getDocumentElement() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     * SOAPEnvelope is the Document Elements of this XML docuement
  +     * @return
  +     */
  +    protected Document mDocument;
  +
  +    public Element getDocumentElement()
  +    {
  +        try{
  +            return getEnvelope();
  +        }catch(SOAPException se){
  +            return null;
  +        }
       }
   
  -    public Attr createAttribute(String name) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     *
  +     * @param tagName
  +     * @return
  +     * @throws DOMException
  +     */
  +    public Element createElement(String tagName) throws DOMException {
  +        return document.createElement(tagName);
       }
   
  -    public CDATASection createCDATASection(String data) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public DocumentFragment createDocumentFragment() {
  +        return document.createDocumentFragment();
       }
   
  -    public Comment createComment(String data) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Text createTextNode(String data) {
  +        return document.createTextNode(data);
       }
   
  -    public Element createElement(String tagName) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Comment createComment(String data){
  +        return document.createComment(data);
       }
   
  -    public Element getElementById(String elementId) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public CDATASection createCDATASection(String data) throws DOMException {
  +        return document.createCDATASection(data);
       }
   
  -    public EntityReference createEntityReference(String name) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public ProcessingInstruction createProcessingInstruction(String target, String data)
  +    throws DOMException {
  +        return document.createProcessingInstruction(target,data);
       }
   
  -    public Node importNode(Node importedNode, boolean deep) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Attr createAttribute(String name)throws DOMException {
  +        return document.createAttribute(name);
  +    }
  +
  +    public EntityReference createEntityReference(String name) throws DOMException {
  +        return document.createEntityReference(name);
       }
   
       public NodeList getElementsByTagName(String tagname) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +        return document.getElementsByTagName(tagname);
       }
   
  -    public Text createTextNode(String data) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node importNode(Node importedNode, boolean deep)
  +    throws DOMException {
  +        return document.importNode(importedNode, deep);
       }
   
  -    public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Element createElementNS(String namespaceURI, String qualifiedName)
  +    throws DOMException {
  +        return document.createElementNS(namespaceURI, qualifiedName);
       }
   
  -    public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Attr createAttributeNS(String namespaceURI, String qualifiedName)
  +    throws DOMException {
  +        return document.createAttributeNS(namespaceURI, qualifiedName);
       }
   
       public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +        return document.getElementsByTagNameNS(namespaceURI,localName);
       }
   
  -    public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Element getElementById(String elementId){
  +        return document.getElementById(elementId);
       }
   
  -    public short getNodeType() {
  -        return 0;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    /////////////////////////////////////////////////////////////
  +
  +    public String getEncoding()
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.69");
       }
   
  -    public void normalize() {
  -        //TODO: Fix this for SAAJ 1.2 Implementation
  +    public  void setEncoding(String s)
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.70");
       }
   
  -    public boolean hasAttributes() {
  -        return false;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public  boolean getStandalone()
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.71");
       }
   
  -    public boolean hasChildNodes() {
  -        return false;  //TODO: Fix this for SAAJ 1.2 Implementation
  +
  +    public  void setStandalone(boolean flag)
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.72");
       }
   
  -    public String getLocalName() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public  boolean getStrictErrorChecking()
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.73");
       }
   
  -    public String getNamespaceURI() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +
  +    public  void setStrictErrorChecking(boolean flag)
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented. 74");
       }
   
  -    public String getNodeName() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +
  +    public  String getVersion()
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented. 75");
       }
   
  -    public String getNodeValue() throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +
  +    public  void setVersion(String s)
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.76");
       }
   
  -    public String getPrefix() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +
  +    public  Node adoptNode(Node node)
  +    throws DOMException
  +    {
  +        throw new UnsupportedOperationException("Not yet implemented.77");
       }
   
  -    public void setNodeValue(String nodeValue) throws DOMException {
  -        //TODO: Fix this for SAAJ 1.2 Implementation
  +    /**
  +     *  Node Implementation
  +     */
  +
  +    public String getNodeName(){
  +        return document.getNodeName();
       }
   
  -    public void setPrefix(String prefix) throws DOMException {
  -        //TODO: Fix this for SAAJ 1.2 Implementation
  +    public String getNodeValue() throws DOMException {
  +        return document.getNodeValue();
  +    }
  +
  +    public void setNodeValue(String nodeValue) throws DOMException{
  +        document.setNodeValue(nodeValue);
       }
   
  -    public Document getOwnerDocument() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public short getNodeType() {
  +        return document.getNodeType();
       }
   
  -    public NamedNodeMap getAttributes() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node getParentNode(){
  +        return  document.getParentNode();
  +    }
  +
  +    public NodeList getChildNodes() {
  +        return document.getChildNodes();
       }
   
       public Node getFirstChild() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +        return document.getFirstChild();
       }
   
  -    public Node getLastChild() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node getLastChild(){
  +        return document.getLastChild();
       }
   
  -    public Node getNextSibling() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node getPreviousSibling(){
  +        return document.getPreviousSibling();
       }
   
  -    public Node getParentNode() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node getNextSibling(){
  +        return document.getNextSibling();
       }
   
  -    public Node getPreviousSibling() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public NamedNodeMap getAttributes(){
  +        return document.getAttributes();
       }
   
  -    public Node cloneNode(boolean deep) {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Document getOwnerDocument(){
  +        return document.getOwnerDocument();
       }
   
  -    public NodeList getChildNodes() {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
  +        return document.insertBefore(newChild, refChild);
       }
   
  -    public boolean isSupported(String feature, String version) {
  -        return false;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
  +        return document.replaceChild(newChild, oldChild);
  +    }
  +
  +    public Node removeChild(Node oldChild) throws DOMException {
  +        return document.removeChild(oldChild);
       }
   
       public Node appendChild(Node newChild) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +        return document.appendChild(newChild);
       }
   
  -    public Node removeChild(Node oldChild) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public boolean hasChildNodes(){
  +        return document.hasChildNodes();
  +    }
  +    public Node cloneNode(boolean deep) {
  +        return document.cloneNode(deep);
       }
   
  -    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public void normalize(){
  +        document.normalize();
       }
   
  -    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
  -        return null;  //TODO: Fix this for SAAJ 1.2 Implementation
  +    public boolean isSupported(String feature, String version){
  +        return document.isSupported(feature, version);
  +    }
  +
  +    public String getNamespaceURI() {
  +        return document.getNamespaceURI();
  +    }
  +
  +    public String getPrefix() {
  +        return document.getPrefix();
  +    }
  +
  +    public void setPrefix(String prefix) throws DOMException {
  +        document.setPrefix(prefix);
  +    }
  +    public String getLocalName() {
  +        return document.getLocalName();
  +    }
  +
  +    public boolean hasAttributes(){
  +        return document.hasAttributes();
       }
   }