当前位置: 首页>>代码示例>>Java>>正文


Java EnvelopeImpl类代码示例

本文整理汇总了Java中com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl的典型用法代码示例。如果您正苦于以下问题:Java EnvelopeImpl类的具体用法?Java EnvelopeImpl怎么用?Java EnvelopeImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EnvelopeImpl类属于com.sun.xml.internal.messaging.saaj.soap.impl包,在下文中一共展示了EnvelopeImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: lookForEnvelope

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
protected void lookForEnvelope() throws SOAPException {
    Element envelopeChildElement = document.doGetDocumentElement();
    if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
        envelope = (EnvelopeImpl) envelopeChildElement;
    } else if (!(envelopeChildElement instanceof ElementImpl)) {
        log.severe("SAAJ0512.soap.incorrect.factory.used");
        throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
    } else {
        ElementImpl soapElement = (ElementImpl) envelopeChildElement;
        if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
            String prefix = soapElement.getPrefix();
            String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
            if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) {
                log.severe("SAAJ0513.soap.unknown.ns");
                throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized");
            }
        } else {
            log.severe("SAAJ0514.soap.root.elem.not.named.envelope");
            throw new SOAPExceptionImpl(
                "Unable to create envelope from given source because the root element is not named \"Envelope\"");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:SOAPPartImpl.java

示例2: createEnvelopeFromSource

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:SOAPPart1_1Impl.java

示例3: createEnvelopeFromSource

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
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;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SOAPPart1_2Impl.java

示例4: getEnvelope

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
@Override
public SOAPEnvelope getEnvelope() throws SOAPException {

    // If there is no SOAP envelope already created, then create
    // one from a source if one exists. If there is a newer source
    // then use that source.

    if (sourceWasSet)
          sourceWasSet = false;

    lookForEnvelope();
    if (envelope != null) {
        if (source != null) { // there's a newer source, use it
            document.removeChild(envelope);
            envelope = createEnvelopeFromSource();
        }
    } else if (source != null) {
        envelope = createEnvelopeFromSource();
    } else {
        envelope = createEmptyEnvelope(null);
        document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null);
    }
    return envelope;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:SOAPPartImpl.java

示例5: lookForEnvelope

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
protected void lookForEnvelope() throws SOAPException {
    Element envelopeChildElement = document.doGetDocumentElement();
    org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement);
    if (soapEnvelope == null || soapEnvelope instanceof Envelope) {
        envelope = (EnvelopeImpl) soapEnvelope;
    } else if (document.find(envelopeChildElement) == null) {
        log.severe("SAAJ0512.soap.incorrect.factory.used");
        throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
    } else {
        ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement);
        if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
            String prefix = soapElement.getPrefix();
            String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
            if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) {
                log.severe("SAAJ0513.soap.unknown.ns");
                throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized");
            }
        } else {
            log.severe("SAAJ0514.soap.root.elem.not.named.envelope");
            throw new SOAPExceptionImpl(
                "Unable to create envelope from given source because the root element is not named \"Envelope\"");
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:SOAPPartImpl.java

示例6: createEnvelopeFromSource

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
@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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:SOAPPart1_1Impl.java

示例7: createEnvelopeFromSource

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
@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;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:SOAPPart1_2Impl.java

示例8: LazyEnvelopeStaxReader

import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; //导入依赖的package包/类
public LazyEnvelopeStaxReader(EnvelopeImpl env) throws SOAPException, XMLStreamException {
        super(env);
//        this.env = env;
        bodyQName = new QName(env.getNamespaceURI(), "Body");
        payloadReader = env.getStaxBridge().getPayloadReader();
        int eventType = getEventType();
        while (eventType != START_ELEMENT) {
            eventType = nextTag();
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:LazyEnvelopeStaxReader.java


注:本文中的com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。