本文整理汇总了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\"");
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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\"");
}
}
}
示例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;
}
示例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;
}
示例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();
}
}