1 55 package org.jboss.axis.message; 56 57 import org.jboss.axis.AxisFault; 58 import org.jboss.axis.InternalException; 59 import org.jboss.axis.encoding.DeserializationContext; 60 import org.jboss.axis.utils.Messages; 61 import org.jboss.axis.utils.XMLUtils; 62 import org.jboss.logging.Logger; 63 import org.w3c.dom.Element ; 64 import org.xml.sax.Attributes ; 65 66 import javax.xml.soap.Name ; 67 import javax.xml.soap.SOAPElement ; 68 import javax.xml.soap.SOAPException ; 69 import java.io.InputStream ; 70 71 74 public class SOAPBodyElementAxisImpl extends SOAPBodyElementImpl 75 { 76 private static Logger log = Logger.getLogger(SOAPBodyElementAxisImpl.class.getName()); 77 78 public SOAPBodyElementAxisImpl(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context) throws AxisFault 79 { 80 super(namespace, localPart, prefix, attributes, context); 81 } 82 83 public SOAPBodyElementAxisImpl(String localPart) 84 { 85 super(localPart); 86 } 87 88 public SOAPBodyElementAxisImpl(String namespace, String localPart) 89 { 90 super(namespace, localPart); 91 } 92 93 public SOAPBodyElementAxisImpl(Name name) 94 { 95 super(name); 96 } 97 98 public SOAPBodyElementAxisImpl(Element elem) 99 { 100 super(elem); 101 } 102 103 public SOAPBodyElementAxisImpl() 104 { 105 } 106 107 public SOAPBodyElementAxisImpl(InputStream input) 108 { 109 super(getDocumentElement(input)); 110 } 111 112 private static Element getDocumentElement(InputStream input) 113 { 114 try 115 { 116 return XMLUtils.newDocument(input).getDocumentElement(); 117 } 118 catch (Exception e) 119 { 120 throw new InternalException(e); 121 } 122 } 123 124 public void setParentElement(SOAPElement parent) throws SOAPException 125 { 126 if (parent == null) 127 throw new IllegalArgumentException (Messages.getMessage("nullParent00")); 128 if (parent instanceof SOAPEnvelopeAxisImpl) 130 { 131 log.warn(Messages.getMessage("bodyElementParent")); 132 parent = ((SOAPEnvelopeAxisImpl)parent).getBody(); 133 } 134 try 135 { 136 super.setParentElement((SOAPBodyAxisImpl)parent); 138 } 139 catch (Throwable t) 140 { 141 throw new SOAPException (t); 142 } 143 } 144 145 } 146 | Popular Tags |