1 /* 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.xml.internal.messaging.saaj.soap; 27 28 import java.io.*; 29 import java.util.Iterator; 30 import java.util.logging.Logger; 31 import java.util.logging.Level; 32 33 import javax.activation.DataHandler; 34 import javax.activation.DataSource; 35 import javax.xml.soap.*; 36 import javax.xml.transform.Source; 37 import javax.xml.transform.stream.StreamSource; 38 39 import org.w3c.dom.*; 40 41 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; 42 43 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; 44 import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; 45 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; 46 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; 47 import com.sun.xml.internal.messaging.saaj.util.*; 48 49 import javax.xml.transform.dom.DOMSource; 50 import javax.xml.transform.sax.SAXSource; 51 52 /** 53 * SOAPPartImpl is the first attachment. This contains the XML/SOAP document. 54 * 55 * @author Anil Vijendran (anil@sun.com) 56 */ 57 public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { 58 protected static final Logger log = 59 Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, 60 "com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); 61 62 protected MimeHeaders headers; 63 protected Envelope envelope; 64 protected Source source; 65 protected SOAPDocumentImpl document; 66 67 //flag to indicate if a setContent happened. 68 private boolean sourceWasSet = false; 69 70 // Records whether the input source had an xml decl or not. 111 112 public SOAPEnvelope getEnvelope() throws SOAPException { 113 114 // If there is no SOAP envelope already created, then create 115 // one from a source if one exists. If there is a newer source 116 // then use that source. 117 118 if (sourceWasSet) 119 sourceWasSet = false; 120 121 lookForEnvelope(); 122 if (envelope != null) { 123 if (source != null) { // there's a newer source, use it 124 document.removeChild(envelope); 125 envelope = createEnvelopeFromSource(); 126 } 127 } else if (source != null) { 128 envelope = createEnvelopeFromSource(); 129 } else { 130 envelope = createEmptyEnvelope(null); 131 document.insertBefore(envelope, null); 132 } 133 return envelope; 134 } 135 136 protected void lookForEnvelope() throws SOAPException { 137 Element envelopeChildElement = document.doGetDocumentElement(); 138 if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) { 139 envelope = (EnvelopeImpl) envelopeChildElement; 140 } else if (!(envelopeChildElement instanceof ElementImpl)) { 141 log.severe("SAAJ0512.soap.incorrect.factory.used"); 142 throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction"); 143 } else { 144 ElementImpl soapElement = (ElementImpl) envelopeChildElement; 145 if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) { 146 String prefix = soapElement.getPrefix(); 147 String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix); 148 if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) { 149 log.severe("SAAJ0513.soap.unknown.ns"); 150 throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized"); 151 } 152 } else { 153 log.severe("SAAJ0514.soap.root.elem.not.named.envelope"); 154 throw new SOAPExceptionImpl( 155 "Unable to create envelope from given source because the root element is not named \"Envelope\""); 156 } 157 } 158 } 159 160 public void removeAllMimeHeaders() { 161 headers.removeAllHeaders(); 162 } 163 164 public void removeMimeHeader(String header) { 481 throws DOMException { 482 handleNewSource(); 483 return document.appendChild(newChild); 484 } 485 486 public org.w3c.dom.Node cloneNode(boolean deep) { 487 handleNewSource(); 488 return document.cloneNode(deep); 489 } 490 491 protected SOAPPartImpl doCloneNode() { 492 handleNewSource(); 493 SOAPPartImpl newSoapPart = duplicateType(); 494 495 newSoapPart.headers = MimeHeadersUtil.copy(this.headers); 496 newSoapPart.source = this.source; 497 return newSoapPart; 498 } 499 500 public NamedNodeMap getAttributes() { 501 return document.getAttributes(); 502 } 503 504 public NodeList getChildNodes() { 505 handleNewSource(); 506 return document.getChildNodes(); 507 } 508 509 public org.w3c.dom.Node getFirstChild() { 510 handleNewSource(); 511 return document.getFirstChild(); 512 } 513 514 public org.w3c.dom.Node getLastChild() { 515 handleNewSource(); 516 return document.getLastChild(); 517 } 518 519 public String getLocalName() { 520 return document.getLocalName(); 521 } 522 523 public String getNamespaceURI() { 524 return document.getNamespaceURI(); 525 } 526 527 public org.w3c.dom.Node getNextSibling() { 528 handleNewSource(); 529 return document.getNextSibling(); 530 } 531 532 public String getNodeName() { 533 return document.getNodeName(); 534 } 535 536 public short getNodeType() { 537 return document.getNodeType(); 538 } 539 540 public String getNodeValue() throws DOMException { 541 return document.getNodeValue(); 542 } 543 544 public Document getOwnerDocument() { 545 return document.getOwnerDocument(); 546 } 547 548 public org.w3c.dom.Node getParentNode() { 549 return document.getParentNode(); 550 } 551 552 public String getPrefix() { 553 return document.getPrefix(); 554 } 555 556 public org.w3c.dom.Node getPreviousSibling() { 557 return document.getPreviousSibling(); 558 } 559 560 public boolean hasAttributes() { 561 return document.hasAttributes(); 562 } 563 564 public boolean hasChildNodes() { 565 handleNewSource(); 566 return document.hasChildNodes(); 567 } 568 569 public org.w3c.dom.Node insertBefore( 570 org.w3c.dom.Node arg0, 571 org.w3c.dom.Node arg1) 572 throws DOMException { 573 handleNewSource(); 574 return document.insertBefore(arg0, arg1); 575 } 576 577 public boolean isSupported(String arg0, String arg1) { 578 return document.isSupported(arg0, arg1); 579 } 580 581 public void normalize() { 582 handleNewSource(); 583 document.normalize(); 584 } 585 586 public org.w3c.dom.Node removeChild(org.w3c.dom.Node arg0) 587 throws DOMException { 588 handleNewSource(); 589 return document.removeChild(arg0); 590 } 591 592 public org.w3c.dom.Node replaceChild( 593 org.w3c.dom.Node arg0, 594 org.w3c.dom.Node arg1) 595 throws DOMException { 596 handleNewSource(); 597 return document.replaceChild(arg0, arg1); 598 } 669 //TODO: A Domsource maynot contain XMLDecl ?. 670 } 671 return null; 672 } 673 674 public void setSourceCharsetEncoding(String charset) { 675 this.sourceCharsetEncoding = charset; 676 } 677 678 public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName) 679 throws DOMException { 680 handleNewSource(); 681 return document.renameNode(n, namespaceURI, qualifiedName); 682 } 683 684 public void normalizeDocument() { 685 document.normalizeDocument(); 686 } 687 688 public DOMConfiguration getDomConfig() { 689 return document.getDomConfig(); 690 } 691 692 public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException { 693 handleNewSource(); 694 return document.adoptNode(source); 695 } 696 697 public void setDocumentURI(String documentURI) { 698 document.setDocumentURI(documentURI); 699 } 700 701 public String getDocumentURI() { 702 return document.getDocumentURI(); 703 } 704 705 public void setStrictErrorChecking(boolean strictErrorChecking) { 706 document.setStrictErrorChecking(strictErrorChecking); 707 } 708 709 public String getInputEncoding() { 710 return document.getInputEncoding(); 711 } 712 713 public String getXmlEncoding() { 714 return document.getXmlEncoding(); 715 } 716 717 public boolean getXmlStandalone() { 718 return document.getXmlStandalone(); 719 } 720 721 public void setXmlStandalone(boolean xmlStandalone) throws DOMException { 722 document.setXmlStandalone(xmlStandalone); 723 } 724 725 public String getXmlVersion() { 726 return document.getXmlVersion(); 727 } 728 729 public void setXmlVersion(String xmlVersion) throws DOMException { 730 document.setXmlVersion(xmlVersion); 731 } 732 733 public boolean getStrictErrorChecking() { 734 return document.getStrictErrorChecking(); 735 } 736 737 // DOM L3 methods from org.w3c.dom.Node 738 public String getBaseURI() { 739 return document.getBaseURI(); 740 } 741 742 public short compareDocumentPosition(org.w3c.dom.Node other) 743 throws DOMException { 744 return document.compareDocumentPosition(other); 745 } 746 747 public String getTextContent() 748 throws DOMException { 749 return document.getTextContent(); 750 } 751 752 public void setTextContent(String textContent) throws DOMException { 753 document.setTextContent(textContent); 754 } 755 756 public boolean isSameNode(org.w3c.dom.Node other) { 757 return document.isSameNode(other); 758 } 759 760 public String lookupPrefix(String namespaceURI) { 761 return document.lookupPrefix(namespaceURI); 762 } 763 764 public boolean isDefaultNamespace(String namespaceURI) { 765 return document.isDefaultNamespace(namespaceURI); 766 } 767 768 public String lookupNamespaceURI(String prefix) { 769 return document.lookupNamespaceURI(prefix); 770 } 771 772 public boolean isEqualNode(org.w3c.dom.Node arg) { 773 return document.isEqualNode(arg); 774 } 775 776 public Object getFeature(String feature, 777 String version) { 778 return document.getFeature(feature,version); 779 } 780 781 public Object setUserData(String key, 782 Object data, 783 UserDataHandler handler) { 784 return document.setUserData(key, data, handler); 785 } 786 787 public Object getUserData(String key) { 788 return document.getUserData(key); 789 } 790 791 public void recycleNode() { 792 // Nothing seems to be required to be done here 793 } 794 795 public String getValue() { 796 return null; 797 } 798 799 public void setValue(String value) { 800 log.severe("SAAJ0571.soappart.setValue.not.defined"); 801 throw new IllegalStateException("Setting value of a soap part is not defined"); 802 } 803 804 public void setParentElement(SOAPElement parent) throws SOAPException { 805 log.severe("SAAJ0570.soappart.parent.element.not.defined"); 806 throw new SOAPExceptionImpl("The parent element of a soap part is not defined"); 807 } 808 | 1 /* 2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.xml.internal.messaging.saaj.soap; 27 28 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; 29 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; 30 import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; 31 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; 32 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; 33 import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; 34 import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; 35 import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection; 36 import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource; 37 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; 38 import com.sun.xml.internal.messaging.saaj.util.MimeHeadersUtil; 39 import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; 40 import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser; 41 import org.w3c.dom.Attr; 42 import org.w3c.dom.CDATASection; 43 import org.w3c.dom.Comment; 44 import org.w3c.dom.DOMConfiguration; 45 import org.w3c.dom.DOMException; 46 import org.w3c.dom.DOMImplementation; 47 import org.w3c.dom.Document; 48 import org.w3c.dom.DocumentFragment; 49 import org.w3c.dom.DocumentType; 50 import org.w3c.dom.Element; 51 import org.w3c.dom.EntityReference; 52 import org.w3c.dom.NamedNodeMap; 53 import org.w3c.dom.NodeList; 54 import org.w3c.dom.ProcessingInstruction; 55 import org.w3c.dom.UserDataHandler; 56 57 import javax.activation.DataHandler; 58 import javax.activation.DataSource; 59 import javax.xml.soap.MimeHeaders; 60 import javax.xml.soap.SOAPElement; 61 import javax.xml.soap.SOAPEnvelope; 62 import javax.xml.soap.SOAPException; 63 import javax.xml.soap.SOAPPart; 64 import javax.xml.transform.Source; 65 import javax.xml.transform.dom.DOMSource; 66 import javax.xml.transform.sax.SAXSource; 67 import javax.xml.transform.stream.StreamSource; 68 import java.io.IOException; 69 import java.io.InputStream; 70 import java.io.InputStreamReader; 71 import java.io.OutputStream; 72 import java.io.PushbackReader; 73 import java.io.Reader; 74 import java.io.UnsupportedEncodingException; 75 import java.util.Iterator; 76 import java.util.logging.Level; 77 import java.util.logging.Logger; 78 79 /** 80 * SOAPPartImpl is the first attachment. This contains the XML/SOAP document. 81 * 82 * @author Anil Vijendran (anil@sun.com) 83 */ 84 public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { 85 protected static final Logger log = 86 Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, 87 "com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); 88 89 protected MimeHeaders headers; 90 protected Envelope envelope; 91 protected Source source; 92 protected SOAPDocumentImpl document; 93 94 //flag to indicate if a setContent happened. 95 private boolean sourceWasSet = false; 96 97 // Records whether the input source had an xml decl or not. 138 139 public SOAPEnvelope getEnvelope() throws SOAPException { 140 141 // If there is no SOAP envelope already created, then create 142 // one from a source if one exists. If there is a newer source 143 // then use that source. 144 145 if (sourceWasSet) 146 sourceWasSet = false; 147 148 lookForEnvelope(); 149 if (envelope != null) { 150 if (source != null) { // there's a newer source, use it 151 document.removeChild(envelope); 152 envelope = createEnvelopeFromSource(); 153 } 154 } else if (source != null) { 155 envelope = createEnvelopeFromSource(); 156 } else { 157 envelope = createEmptyEnvelope(null); 158 document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null); 159 } 160 return envelope; 161 } 162 163 protected void lookForEnvelope() throws SOAPException { 164 Element envelopeChildElement = document.doGetDocumentElement(); 165 org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement); 166 if (soapEnvelope == null || soapEnvelope instanceof Envelope) { 167 envelope = (EnvelopeImpl) soapEnvelope; 168 } else if (document.find(envelopeChildElement) == null) { 169 log.severe("SAAJ0512.soap.incorrect.factory.used"); 170 throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction"); 171 } else { 172 ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement); 173 if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) { 174 String prefix = soapElement.getPrefix(); 175 String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix); 176 if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) { 177 log.severe("SAAJ0513.soap.unknown.ns"); 178 throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized"); 179 } 180 } else { 181 log.severe("SAAJ0514.soap.root.elem.not.named.envelope"); 182 throw new SOAPExceptionImpl( 183 "Unable to create envelope from given source because the root element is not named \"Envelope\""); 184 } 185 } 186 } 187 188 public void removeAllMimeHeaders() { 189 headers.removeAllHeaders(); 190 } 191 192 public void removeMimeHeader(String header) { 509 throws DOMException { 510 handleNewSource(); 511 return document.appendChild(newChild); 512 } 513 514 public org.w3c.dom.Node cloneNode(boolean deep) { 515 handleNewSource(); 516 return document.cloneNode(deep); 517 } 518 519 protected SOAPPartImpl doCloneNode() { 520 handleNewSource(); 521 SOAPPartImpl newSoapPart = duplicateType(); 522 523 newSoapPart.headers = MimeHeadersUtil.copy(this.headers); 524 newSoapPart.source = this.source; 525 return newSoapPart; 526 } 527 528 public NamedNodeMap getAttributes() { 529 return document.getDomDocument().getAttributes(); 530 } 531 532 public NodeList getChildNodes() { 533 handleNewSource(); 534 return document.getChildNodes(); 535 } 536 537 public org.w3c.dom.Node getFirstChild() { 538 handleNewSource(); 539 return document.getFirstChild(); 540 } 541 542 public org.w3c.dom.Node getLastChild() { 543 handleNewSource(); 544 return document.getLastChild(); 545 } 546 547 public String getLocalName() { 548 return document.getDomDocument().getLocalName(); 549 } 550 551 public String getNamespaceURI() { 552 return document.getDomDocument().getNamespaceURI(); 553 } 554 555 public org.w3c.dom.Node getNextSibling() { 556 handleNewSource(); 557 return document.getNextSibling(); 558 } 559 560 public String getNodeName() { 561 return document.getDomDocument().getNodeName(); 562 } 563 564 public short getNodeType() { 565 return document.getDomDocument().getNodeType(); 566 } 567 568 public String getNodeValue() throws DOMException { 569 return document.getNodeValue(); 570 } 571 572 public Document getOwnerDocument() { 573 return document.getDomDocument().getOwnerDocument(); 574 } 575 576 public org.w3c.dom.Node getParentNode() { 577 return document.getDomDocument().getParentNode(); 578 } 579 580 public String getPrefix() { 581 return document.getDomDocument().getPrefix(); 582 } 583 584 public org.w3c.dom.Node getPreviousSibling() { 585 return document.getDomDocument().getPreviousSibling(); 586 } 587 588 public boolean hasAttributes() { 589 return document.getDomDocument().hasAttributes(); 590 } 591 592 public boolean hasChildNodes() { 593 handleNewSource(); 594 return document.hasChildNodes(); 595 } 596 597 public org.w3c.dom.Node insertBefore( 598 org.w3c.dom.Node arg0, 599 org.w3c.dom.Node arg1) 600 throws DOMException { 601 handleNewSource(); 602 return document.insertBefore(arg0, arg1); 603 } 604 605 public boolean isSupported(String arg0, String arg1) { 606 return document.getDomDocument().isSupported(arg0, arg1); 607 } 608 609 public void normalize() { 610 handleNewSource(); 611 document.normalize(); 612 } 613 614 public org.w3c.dom.Node removeChild(org.w3c.dom.Node arg0) 615 throws DOMException { 616 handleNewSource(); 617 return document.removeChild(arg0); 618 } 619 620 public org.w3c.dom.Node replaceChild( 621 org.w3c.dom.Node arg0, 622 org.w3c.dom.Node arg1) 623 throws DOMException { 624 handleNewSource(); 625 return document.replaceChild(arg0, arg1); 626 } 697 //TODO: A Domsource maynot contain XMLDecl ?. 698 } 699 return null; 700 } 701 702 public void setSourceCharsetEncoding(String charset) { 703 this.sourceCharsetEncoding = charset; 704 } 705 706 public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName) 707 throws DOMException { 708 handleNewSource(); 709 return document.renameNode(n, namespaceURI, qualifiedName); 710 } 711 712 public void normalizeDocument() { 713 document.normalizeDocument(); 714 } 715 716 public DOMConfiguration getDomConfig() { 717 return document.getDomDocument().getDomConfig(); 718 } 719 720 public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException { 721 handleNewSource(); 722 return document.adoptNode(source); 723 } 724 725 public void setDocumentURI(String documentURI) { 726 document.setDocumentURI(documentURI); 727 } 728 729 public String getDocumentURI() { 730 return document.getDomDocument().getDocumentURI(); 731 } 732 733 public void setStrictErrorChecking(boolean strictErrorChecking) { 734 document.setStrictErrorChecking(strictErrorChecking); 735 } 736 737 public String getInputEncoding() { 738 return document.getDomDocument().getInputEncoding(); 739 } 740 741 public String getXmlEncoding() { 742 return document.getDomDocument().getXmlEncoding(); 743 } 744 745 public boolean getXmlStandalone() { 746 return document.getDomDocument().getXmlStandalone(); 747 } 748 749 public void setXmlStandalone(boolean xmlStandalone) throws DOMException { 750 document.setXmlStandalone(xmlStandalone); 751 } 752 753 public String getXmlVersion() { 754 return document.getDomDocument().getXmlVersion(); 755 } 756 757 public void setXmlVersion(String xmlVersion) throws DOMException { 758 document.setXmlVersion(xmlVersion); 759 } 760 761 public boolean getStrictErrorChecking() { 762 return document.getDomDocument().getStrictErrorChecking(); 763 } 764 765 // DOM L3 methods from org.w3c.dom.Node 766 public String getBaseURI() { 767 return document.getDomDocument().getBaseURI(); 768 } 769 770 public short compareDocumentPosition(org.w3c.dom.Node other) 771 throws DOMException { 772 return document.compareDocumentPosition(other); 773 } 774 775 public String getTextContent() 776 throws DOMException { 777 return document.getTextContent(); 778 } 779 780 public void setTextContent(String textContent) throws DOMException { 781 document.setTextContent(textContent); 782 } 783 784 public boolean isSameNode(org.w3c.dom.Node other) { 785 return document.isSameNode(other); 786 } 787 788 public String lookupPrefix(String namespaceURI) { 789 return document.getDomDocument().lookupPrefix(namespaceURI); 790 } 791 792 public boolean isDefaultNamespace(String namespaceURI) { 793 return document.isDefaultNamespace(namespaceURI); 794 } 795 796 public String lookupNamespaceURI(String prefix) { 797 return document.lookupNamespaceURI(prefix); 798 } 799 800 public boolean isEqualNode(org.w3c.dom.Node arg) { 801 return document.getDomDocument().isEqualNode(arg); 802 } 803 804 public Object getFeature(String feature, 805 String version) { 806 return document.getFeature(feature,version); 807 } 808 809 public Object setUserData(String key, 810 Object data, 811 UserDataHandler handler) { 812 return document.setUserData(key, data, handler); 813 } 814 815 public Object getUserData(String key) { 816 return document.getDomDocument().getUserData(key); 817 } 818 819 public void recycleNode() { 820 // Nothing seems to be required to be done here 821 } 822 823 public String getValue() { 824 return null; 825 } 826 827 public void setValue(String value) { 828 log.severe("SAAJ0571.soappart.setValue.not.defined"); 829 throw new IllegalStateException("Setting value of a soap part is not defined"); 830 } 831 832 public void setParentElement(SOAPElement parent) throws SOAPException { 833 log.severe("SAAJ0570.soappart.parent.element.not.defined"); 834 throw new SOAPExceptionImpl("The parent element of a soap part is not defined"); 835 } 836 |