com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser Java Examples

The following examples show how to use com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser. 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: SOAPPart1_1Impl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #2
Source File: SOAPPart1_2Impl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #3
Source File: SOAPPart1_1Impl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #4
Source File: SOAPPart1_2Impl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #5
Source File: SOAPPart1_1Impl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #6
Source File: SOAPPart1_2Impl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #7
Source File: SOAPPart1_1Impl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #8
Source File: SOAPPart1_2Impl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #9
Source File: SOAPPart1_1Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #10
Source File: SOAPPart1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #11
Source File: SOAPPart1_1Impl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #12
Source File: SOAPPart1_2Impl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #13
Source File: SOAPPart1_1Impl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #14
Source File: SOAPPart1_2Impl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}
 
Example #15
Source File: SOAPPart1_1Impl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    // Record the presence of xml declaration before the envelope gets
    // created.
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope =
        (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
        log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
    }

    if (parser != null && !omitXmlDecl) {
        envelope.setOmitXmlDecl("no");
        envelope.setXmlDecl(parser.getXmlDeclaration());
        envelope.setCharsetEncoding(parser.getEncoding());
    }
    return envelope;
}
 
Example #16
Source File: SOAPPart1_2Impl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected Envelope createEnvelopeFromSource() throws SOAPException {
    XMLDeclarationParser parser = lookForXmlDecl();
    Source tmp = source;
    source = null;
    EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
    if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
        log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
        throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
    }

    if (parser != null) { //can be null if source was a DomSource and not StreamSource
        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
    }
    return envelope;

}