javax.xml.stream.XMLStreamException#getCause ( )源码实例Demo

下面列出了javax.xml.stream.XMLStreamException#getCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: cxf   文件: SoapOutInterceptor.java
public void handleMessage(SoapMessage message) throws Fault {
    try {
        XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
        if (xtw != null) {
            // Write body end
            xtw.writeEndElement();
            // Write Envelope end element
            xtw.writeEndElement();
            xtw.writeEndDocument();

            xtw.flush();
        }
    } catch (XMLStreamException e) {
        if (e.getCause() instanceof EOFException) {
            //Nothing we can do about this, some clients will close the connection early if
            //they fully parse everything they need
        } else {
            SoapVersion soapVersion = message.getVersion();
            throw new SoapFault(new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), e,
                                soapVersion.getSender());
        }
    }
}
 
源代码2 项目: TencentKona-8   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码3 项目: galleon   文件: FeatureGroupParsingTestCase.java
@Test
public void testFeatureIdParameterInIncludeConflict() throws Exception {
    try {
        parseConfig("feature-id-parameter-in-include-conflict.xml");
    } catch(XMLStreamException e) {
        Assert.assertEquals("Failed to parse config", e.getMessage());
        Throwable cause = e.getCause();
        assertNotNull(cause);
        assertEquals("Parameter p2 has value 'v2' in feature ID and value 'v22' in the feature body", cause.getMessage());
    }
}
 
源代码4 项目: jdk8u60   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码5 项目: openjdk-jdk8u   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码7 项目: openjdk-jdk9   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg, soapVersion.nsUri);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码8 项目: hottub   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码9 项目: openjdk-8-source   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}
 
源代码10 项目: openjdk-8   文件: SAAJFactory.java
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public SOAPMessage readAsSOAPMessage(final SOAPVersion soapVersion, final Message message) throws SOAPException {
SOAPMessage msg = soapVersion.getMessageFactory().createMessage();
SaajStaxWriter writer = new SaajStaxWriter(msg);
try {
    message.writeTo(writer);
} catch (XMLStreamException e) {
    throw (e.getCause() instanceof SOAPException) ? (SOAPException) e.getCause() : new SOAPException(e);
}
msg = writer.getSOAPMessage();
addAttachmentsToSOAPMessage(msg, message);
if (msg.saveRequired())
        msg.saveChanges();
return msg;
}