com.sun.xml.internal.ws.message.DOMMessage Java Examples

The following examples show how to use com.sun.xml.internal.ws.message.DOMMessage. 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: Messages.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #2
Source File: LogicalMessageImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #3
Source File: Messages.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #4
Source File: LogicalMessageImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #5
Source File: Messages.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #6
Source File: LogicalMessageImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #7
Source File: Messages.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #8
Source File: LogicalMessageImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #9
Source File: Messages.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #10
Source File: LogicalMessageImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #11
Source File: Messages.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #12
Source File: Messages.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #13
Source File: LogicalMessageImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #14
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #15
Source File: LogicalMessageImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example #16
Source File: Messages.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * the whole SOAP message.
 *
 * @param soapEnvelope
 *      The SOAP envelope element.
 */
public static Message create(Element soapEnvelope) {
    SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
    // find the headers
    Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
    HeaderList headers = null;
    if(header!=null) {
        for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
            if(n.getNodeType()==Node.ELEMENT_NODE) {
                if(headers==null)
                    headers = new HeaderList(ver);
                headers.add(Headers.create((Element)n));
            }
        }
    }

    // find the payload
    Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
    if(body==null)
        throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
    Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

    if(payload==null) {
        return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
    } else {
        return new DOMMessage(ver,headers,payload);
    }
}
 
Example #17
Source File: Messages.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #18
Source File: Messages.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #19
Source File: Messages.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #20
Source File: Messages.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #21
Source File: Messages.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #22
Source File: Messages.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #23
Source File: Messages.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #24
Source File: Messages.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #25
Source File: Messages.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #26
Source File: Messages.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #27
Source File: Messages.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}
 
Example #28
Source File: Messages.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #29
Source File: Messages.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a {@link Message} from an {@link Element} that represents
 * a payload.
 *
 * @param payload
 *      The element that becomes the child element of the SOAP body.
 *      Must not be null.
 *
 * @param ver
 *      The SOAP version of the message. Must not be null.
 */
public static Message createUsingPayload(Element payload, SOAPVersion ver) {
    return new DOMMessage(ver,payload);
}
 
Example #30
Source File: Messages.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates a fault {@link Message}.
 *
 * <p>
 * This method is not designed for efficiency, and we don't expect
 * to be used for the performance critical codepath.
 *
 * @param fault
 *      The populated SAAJ data structure that represents a fault
 *      in detail.
 *
 * @return
 *      Always non-null. A message that wraps this {@link SOAPFault}.
 */
public static Message create(SOAPFault fault) {
    SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
    return new DOMMessage(ver,fault);
}