Java Code Examples for com.sun.xml.internal.ws.util.DOMUtil#createDom()
The following examples show how to use
com.sun.xml.internal.ws.util.DOMUtil#createDom() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SOAPFaultBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 2
Source File: SOAPFaultBuilder.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 3
Source File: SOAPFaultBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 4
Source File: SOAPFaultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 5
Source File: SOAPFaultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 6
Source File: SOAPFaultBuilder.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 7
Source File: SOAPFaultBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 8
Source File: SOAPFaultBuilder.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Creates a DOM node that represents the complete stack trace of the exception, * and attach that to {@link DetailType}. */ final void captureStackTrace(@Nullable Throwable t) { if(t==null) return; if(!captureStackTrace) return; // feature disabled try { Document d = DOMUtil.createDom(); ExceptionBean.marshal(t,d); DetailType detail = getDetail(); if(detail==null) setDetail(detail=new DetailType()); detail.getDetails().add(d.getDocumentElement()); } catch (JAXBException e) { // this should never happen logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e); } }
Example 9
Source File: Packet.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 10
Source File: Packet.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 11
Source File: Packet.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 12
Source File: Packet.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 13
Source File: Packet.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 14
Source File: Packet.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 15
Source File: Packet.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }
Example 16
Source File: Packet.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Gives a list of Reference Parameters in the Message * <p> * Headers which have attribute wsa:IsReferenceParameter="true" * This is not cached as one may reset the Message. *<p> */ @Property(MessageContext.REFERENCE_PARAMETERS) public @NotNull List<Element> getReferenceParameters() { Message msg = getMessage(); List<Element> refParams = new ArrayList<Element>(); if (msg == null) { return refParams; } MessageHeaders hl = msg.getHeaders(); for (Header h : hl.asList()) { String attr = h.getAttribute(AddressingVersion.W3C.nsUri, "IsReferenceParameter"); if (attr != null && (attr.equals("true") || attr.equals("1"))) { Document d = DOMUtil.createDom(); SAX2DOMEx s2d = new SAX2DOMEx(d); try { h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER); refParams.add((Element) d.getLastChild()); } catch (SAXException e) { throw new WebServiceException(e); } /* DOMResult result = new DOMResult(d); XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result); try { h.writeTo(domwriter); refParams.add((Element) result.getNode().getLastChild()); } catch (XMLStreamException e) { throw new WebServiceException(e); } */ } } return refParams; }