Examples of WsException


Examples of org.jibx.ws.WsException

     */
    public void endFault() throws WsException {
        try {
            m_wrapper.parsePastEndTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_FAULTNAME);
        } catch (JiBXException e) {
            throw new WsException("Error reading end of fault.", e);
        }
    }
View Full Code Here

Examples of org.jibx.ws.WsException

     */
    public void endMessage() throws WsException {
        try {
            m_wrapper.parsePastEndTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_ENVNAME);
        } catch (JiBXException e) {
            throw new WsException("Expected end tag for SOAP envelope.", e);
        }
    }
View Full Code Here

Examples of org.jibx.ws.WsException

    public boolean isBodyFault() throws WsException {
        try {
            // Determine if first body element is SOAP Fault
            return m_wrapper.isAtStart(SoapConstants.SOAP_URI, SoapConstants.SOAP_FAULTNAME);
        } catch (JiBXException e) {
            throw new WsException("Error checking for start of SOAP Fault.", e);
        }
    }
View Full Code Here

Examples of org.jibx.ws.WsException

                    context.setBody(fault);
                } else {
                    // Handle SOAP body
                    context.invokeBodyReader(xmlReader);
                    if (context.getBody() == null) {
                        throw new WsException("No handlers could be found for unmarshalling the SOAP body payload");
                    }
                }
            }
            soapReader.endBody();
            soapReader.endMessage();
View Full Code Here

Examples of org.jibx.ws.WsException

                } else {
                    wrpr.skipPastEndTag(xmlReader.getNamespace(), xmlReader.getName());
                }
            }
        } catch (JiBXException e) {
            throw new WsException("Error while unmarshalling SOAP fault details", e);
        }
    }
View Full Code Here

Examples of org.jibx.ws.WsException

                    }
                    wrpr.skipPastEndTag(xmlReader.getNamespace(), xmlReader.getName());
                }
            }
        } catch (JiBXException e) {
            throw new WsException("Error while unmarshalling SOAP header details", e);
        }
    }
View Full Code Here

Examples of org.jibx.ws.WsException

            IUnmarshaller unmarshaller = m_unmarshallCtx.getUnmarshaller(xmlReader.getNamespace(), name);
            if (unmarshaller != null) {
                payload = unmarshaller.unmarshal(null, m_unmarshallCtx);
            }
        } catch (JiBXException e) {
            throw new WsException("Error in unmarshalling.", e);
        }

        return payload;
    }
View Full Code Here

Examples of org.jibx.ws.WsException

    public void invoke(IXMLWriter xmlWriter, Object payload) throws IOException, WsException {
        if (logger.isDebugEnabled()) {
            logger.debug("Attempting to marshall payload '" + payload + "'");
        }
        if (!(payload instanceof IMarshallable)) {
            throw new WsException("Payload object must have a defined mapping");
        }
           
        // find first difference between current namespaces and those needed for payload
        String[] nss = xmlWriter.getNamespaces();
        int limit = Math.min(nss.length, m_namespaces.length);
        int index = 0;
        for (; index < limit; index++) {
            if (!nss[index].equals(m_namespaces[index])) {
                break;
            }
        }
        if (index < m_namespaces.length) {
           
            // push payload namespaces as extension
            int base = xmlWriter.getNamespaceCount();
            String[] extnss = new String[m_namespaces.length - index];
            System.arraycopy(m_namespaces, index, extnss, 0, extnss.length);
            xmlWriter.pushExtensionNamespaces(extnss);
           
            // build translation table to correct namespaces when accessed by index
            int[] xlates = new int[m_namespaces.length];
            for (int i = 0; i < xlates.length; i++) {
                if (i < index) {
                    xlates[i] = i;
                } else {
                    xlates[i] = base + i - index;
                }
            }
            xmlWriter.pushTranslationTable(xlates);
           
        }
        try {
            m_marshaller.setXmlWriter(xmlWriter);

            try {
                ((IMarshallable) payload).marshal(m_marshaller);
            } catch (JiBXException e) {
                throw new WsException("Unable to marshal payload.", e);
            }
        } finally {
            if (index < m_namespaces.length) {
                xmlWriter.popTranslationTable();
                xmlWriter.popExtensionNamespaces();
View Full Code Here

Examples of org.jibx.ws.WsException

        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

Examples of org.jibx.ws.WsException

     * attributeName specified in the constructor.
     */
    public void invoke(OutContext context, IXMLWriter xmlWriter) throws IOException, WsException {
        Object payload = context.getAttribute(m_attributeName);
        if (payload == null) {
            throw new WsException("Unable to write header data since attribute " + m_attributeName
                + " is null in OutContext");
        }
        m_marshaller.invoke(xmlWriter, payload);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.