src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
child 1341
e5cc521294d8
equal deleted inserted replaced
366:8c0b6bccfe47 368:0989ad8c0860
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 package com.sun.xml.internal.messaging.saaj.soap.impl; 26 package com.sun.xml.internal.messaging.saaj.soap.impl;
27 27
28 import java.net.URI;
29 import java.net.URISyntaxException;
28 import java.util.*; 30 import java.util.*;
29 import java.util.logging.Level; 31 import java.util.logging.Level;
30 import java.util.logging.Logger; 32 import java.util.logging.Logger;
31 33
32 import javax.xml.namespace.QName; 34 import javax.xml.namespace.QName;
107 } 109 }
108 } 110 }
109 } 111 }
110 112
111 public Document getOwnerDocument() { 113 public Document getOwnerDocument() {
112 SOAPDocument ownerSOAPDocument = 114 Document doc = super.getOwnerDocument();
113 ((SOAPDocument) super.getOwnerDocument()); 115 if (doc instanceof SOAPDocument)
114 if (ownerSOAPDocument == null) { 116 return ((SOAPDocument) doc).getDocument();
115 return null; 117 else
116 } 118 return doc;
117 return ownerSOAPDocument.getDocument();
118 } 119 }
119 120
120 public SOAPElement addChildElement(Name name) throws SOAPException { 121 public SOAPElement addChildElement(Name name) throws SOAPException {
121 return addElement(name); 122 return addElement(name);
122 } 123 }
797 } 798 }
798 799
799 public void setEncodingStyle(String encodingStyle) throws SOAPException { 800 public void setEncodingStyle(String encodingStyle) throws SOAPException {
800 if (!"".equals(encodingStyle)) { 801 if (!"".equals(encodingStyle)) {
801 try { 802 try {
802 JaxmURI uri = new JaxmURI(encodingStyle); 803 new URI(encodingStyle);
803 } catch (JaxmURI.MalformedURIException m) { 804 } catch (URISyntaxException m) {
804 log.log( 805 log.log(
805 Level.SEVERE, 806 Level.SEVERE,
806 "SAAJ0105.impl.encoding.style.mustbe.valid.URI", 807 "SAAJ0105.impl.encoding.style.mustbe.valid.URI",
807 new String[] { encodingStyle }); 808 new String[] { encodingStyle });
808 throw new IllegalArgumentException( 809 throw new IllegalArgumentException(
1224 // should be removed once the corresponding JAXP bug is fixed 1225 // should be removed once the corresponding JAXP bug is fixed
1225 // It appears the bug will be fixed in JAXP 1.4 (not by Appserver 9 timeframe) 1226 // It appears the bug will be fixed in JAXP 1.4 (not by Appserver 9 timeframe)
1226 public void setAttributeNS( 1227 public void setAttributeNS(
1227 String namespaceURI,String qualifiedName, String value) { 1228 String namespaceURI,String qualifiedName, String value) {
1228 int index = qualifiedName.indexOf(':'); 1229 int index = qualifiedName.indexOf(':');
1229 String prefix, localName; 1230 String localName;
1230 if (index < 0) { 1231 if (index < 0)
1231 prefix = null;
1232 localName = qualifiedName; 1232 localName = qualifiedName;
1233 } 1233 else
1234 else {
1235 prefix = qualifiedName.substring(0, index);
1236 localName = qualifiedName.substring(index + 1); 1234 localName = qualifiedName.substring(index + 1);
1237 }
1238 1235
1239 // Workaround for bug 6467808 - This needs to be fixed in JAXP 1236 // Workaround for bug 6467808 - This needs to be fixed in JAXP
1240 1237
1241 // Rolling back this fix, this is a wrong fix, infact its causing other regressions in JAXWS tck and 1238 // Rolling back this fix, this is a wrong fix, infact its causing other regressions in JAXWS tck and
1242 // other tests, because of this change the namespace declarations on soapenv:Fault element are never 1239 // other tests, because of this change the namespace declarations on soapenv:Fault element are never

mercurial