Package org.jibx.ws

Examples of org.jibx.ws.WsException


                m_wrapper.parsePastStartTag("", SoapConstants.FAULTDETAIL_NAME);
                return true;
            }
            return false;
        } catch (JiBXException e) {
            throw new WsException("Error reading start of fault detail.", e);
        }

    }
View Full Code Here


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

     */
    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

     */
    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

    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

                    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

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

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

            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

    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

TOP

Related Classes of org.jibx.ws.WsException

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.