Package org.jibx.ws.io

Examples of org.jibx.ws.io.XmlReaderWrapper


     * @throws WsException
     */
    private void readSoapFaultDetail(IXMLReader xmlReader, InContext context, SoapFault fault) throws IOException,
        WsException {
        try {
            XmlReaderWrapper wrpr = XmlReaderWrapper.createXmlReaderWrapper(xmlReader);
            while (wrpr.toTag() == IXMLReader.START_TAG) {
                Object detail = null;
                /**
                 * If handlers are defined on the body fault phase, they have the opportunity to add details to the
                 * SoapFault. Otherwise the SOAP details will be skipped.
                 */
                if (context.hasHandlers(SoapPhase.BODY_FAULT)) {
                    detail = context.invokeInHandlers(SoapPhase.BODY_FAULT, xmlReader);
                }
                if (detail != null) {
                    fault.addDetail(detail);
                } else {
                    wrpr.skipPastEndTag(xmlReader.getNamespace(), xmlReader.getName());
                }
            }
        } catch (JiBXException e) {
            throw new WsException("Error while unmarshalling SOAP fault details", e);
        }
View Full Code Here


     * @throws IOException
     * @throws WsException
     */
    private void readSoapHeaders(IXMLReader xmlReader, InContext context) throws IOException, WsException {
        try {
            XmlReaderWrapper wrpr = XmlReaderWrapper.createXmlReaderWrapper(xmlReader);
            while (wrpr.toTag() == IXMLReader.START_TAG) {
                /**
                 * If handlers are defined on the headers, they have the opportunity to read the header. Otherwise the
                 * header will be skipped.
                 */
                Object header = context.invokeInHandlers(SoapPhase.HEADER, xmlReader);
                if (header == null) {
                    String mustUnderstand = xmlReader.getAttributeValue(SoapConstants.SOAP_URI,
                        SoapConstants.MUSTUNDERSTAND_NAME);
                    if (SoapConstants.MUSTUNDERSTAND_TRUE.equals(mustUnderstand)) {
                        throw new WsNotUnderstoodException("");
                    }
                    wrpr.skipPastEndTag(xmlReader.getNamespace(), xmlReader.getName());
                }
            }
        } catch (JiBXException e) {
            throw new WsException("Error while unmarshalling SOAP header details", e);
        }
View Full Code Here

     * @throws IOException on I/O error
     * @throws WsException on parse error, or incorrect start tag
     */
    public Object invoke(InContext context, IXMLReader xmlReader) throws IOException, WsException {
        String content = null;
        XmlReaderWrapper rdr = XmlReaderWrapper.createXmlReaderWrapper(xmlReader);
        try {
            rdr.parsePastStartTag(null, ELEMENT_NAME);
            content = rdr.parseContentText(null, ELEMENT_NAME);
        } catch (JiBXException e) {
            throw new WsException("Unable to parse exception: ", e);
        }
        return content;
    }
View Full Code Here

TOP

Related Classes of org.jibx.ws.io.XmlReaderWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.