@Override public SOAPElement createElement(Element domElement) throws SOAPException { return createElement(domElement, true); }
@Override public SOAPElement createElement(QName qname) throws SOAPException { return createElement(new NameImpl(qname)); }
public SOAPBodyElement addDocument(Document doc) throws SOAPException { Element rootElement = doc.getDocumentElement(); SOAPFactoryImpl soapFactory = new SOAPFactoryImpl(); SOAPElement soapElement = soapFactory.createElement(rootElement); return (SOAPBodyElement)addChildElement(soapElement); }
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws SOAPException { // Construct the envelope SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart(); SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart, (SOAPElementImpl)soapFactory.createElement(domEnv, false), false); DOMUtils.copyAttributes(soapEnv, domEnv); NodeList envChildNodes = domEnv.getChildNodes(); for (int i = 0; i < envChildNodes.getLength(); i++) { Node child = envChildNodes.item(i); short childType = child.getNodeType(); if (childType == Node.ELEMENT_NODE) { String elName = child.getLocalName(); if ("Header".equals(elName)) { buildSOAPHeader(soapEnv, (Element)child); } else if ("Body".equals(elName)) { buildSOAPBody(soapEnv, (Element)child); } else { log.warn(BundleUtils.getMessage(bundle, "IGNORE_ENVELOPE_CHILD", elName)); } } } return soapEnv; }
String nsURI = domElement.getNamespaceURI() != null ? domElement.getNamespaceURI() : ""; SOAPElement soapElement = this.createElement(localName, prefix, nsURI); if (nodeType == Node.ELEMENT_NODE) SOAPElement soapChild = createElement((Element)child); soapElement.addChildElement(soapChild);
SOAPElementImpl soapChild = (SOAPElementImpl)soapFactory.createElement((Element)node); list.add(soapChild); break;
private static SOAPBodyElementDoc convertToBodyElement(Node node) throws DOMException { if (!(node instanceof SOAPElementImpl) && (node instanceof Element)) { try { SOAPFactoryImpl soapFactory = new SOAPFactoryImpl(); node = (SOAPElementImpl)soapFactory.createElement((Element)node); } catch (SOAPException ex) { throw new DOMException(DOMException.INVALID_STATE_ERR, "Could not convert Element to a SOAPElement"); } } if (!(node instanceof SOAPElementImpl)) throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPELEMENT_EXPECTED")); SOAPElementImpl element = (SOAPElementImpl)node; element.detachNode(); return new SOAPBodyElementDoc(element); }
soapElement = (SOAPElementImpl) new SOAPFactoryImpl().createElement((Element) (soapElement.domNode)); DOMUtils.setOwnerDocument(oldDoc);
if (childType == Node.ELEMENT_NODE) SOAPElement soapElement = soapFactory.createElement((Element)child); soapBodyElement.addChildElement(soapElement);
soapBody.addChildElement(soapFactory.createElement((Element)child, true));
SOAPElement soapElement = soapFactory.createElement((Element)child); container.addChildElement(soapElement);
if (childNode instanceof SOAPElement) SOAPElement childClone = soapFactory.createElement((SOAPElement)childNode, true); hrefElement.addChildElement(childClone);
private Detail extractDetail(final QName detailQName) { SOAPElement obj = getChildElement(this, detailQName); Detail detail = null; if (obj instanceof Detail) { detail = (Detail)obj; } else if(obj instanceof SOAPElementImpl) { try { SOAPElementImpl soapEl = (SOAPElementImpl)obj; SOAPFactoryImpl factory = new SOAPFactoryImpl(); detail = (Detail)addChildElement(factory.createDetail()); Iterator<Element> childIt = DOMUtils.getChildElements(soapEl); while (childIt.hasNext()) { Element domElement = childIt.next(); SOAPElement detailEntry = new DetailEntryImpl(factory.createElement(domElement, true)); detail.addChildElement(detailEntry); } } catch (SOAPException e) { throw new WSException(BundleUtils.getMessage(bundle, "UNABLE_TO_CREATE_FAULT_DETAIL", e.getMessage())); } } return detail; }
retNode = new SOAPFactoryImpl().createElement((Element)node);