Package org.jibx.ws

Examples of org.jibx.ws.WsException


                throw new WsTransportException(conn.getErrorMessage());
            }
            logger.debug("Starting receive message");
            context.invokeBodyReader(conn.getReader());
            if (context.getBody() == null) {
                throw new WsException("No handlers could be found for unmarshalling the body payload");
            }
            logger.debug("Message received");
        } finally {
            conn.inputComplete();
        }
View Full Code Here


                    String location = node.getTextContent();
                    node.setTextContent(adaptLocation(location, locationBase));
                }
            }
        } catch (ParserConfigurationException e) {
            throw new WsException("Unable to configure parser for WSDL adapter: " + e.getMessage());
        } catch (SAXException e) {
            throw new WsException("Error parsing supplied WSDL: " + e.getMessage());
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
        try {
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer();

            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(baos);
            transformer.transform(source, result);
        } catch (TransformerException e) {
            throw new WsException("Error transforming WSDL: " + e.getMessage());
        }
        return baos.toByteArray();
    }
View Full Code Here

                args[m_idxs.m_payloadIndex] = payload;
            }
            if (m_idxs.m_inContextIndex != -1) {
                MessageContext currentContext = processor.getCurrentMessageContext();
                if (!(currentContext instanceof InContext)) {
                    throw new WsException(
                        "Error - attempt to invoke operation when current context is not an InContext");
                }
                args[m_idxs.m_inContextIndex] = currentContext;
            }
            if (m_idxs.m_outContextIndex != -1) {
                MessageContext nextContext = processor.getNextMessageContext();
                if (!(nextContext instanceof OutContext)) {
                    throw new WsException(
                        "Error - attempt to invoke 2-way operation when next message context is not an OutContext");
                }
                args[m_idxs.m_outContextIndex] = nextContext;
            }
        }
View Full Code Here

     */
    public void startMessage() throws WsException {
        try {
            m_wrapper.toStart();
            if (!m_wrapper.isAtStart(SoapConstants.SOAP_URI, SoapConstants.SOAP_ENVNAME)) {
                throw new WsException("Message does not begin with SOAP Envelope");
            }
            m_wrapper.parsePastStartTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_ENVNAME);
        } catch (JiBXException e) {
            throw new WsException("Error reading start of SOAP message.", e);
        }
    }
View Full Code Here

                } else {
                    m_wrapper.toStart();
                }
            }
        } catch (JiBXException e) {
            throw new WsException("Error reading start of header.", e);
        }

        return isStartHeader;
    }
View Full Code Here

            isEndHeader = m_wrapper.isAtEnd(SoapConstants.SOAP_URI, SoapConstants.SOAP_HEADERNAME);
            if (isEndHeader) {
                m_wrapper.parsePastEndTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_HEADERNAME);
            }
        } catch (JiBXException e) {
            throw new WsException("Error reading end of header.", e);
        }

        return isEndHeader;
    }
View Full Code Here

            if (m_wrapper.isAtEnd(SoapConstants.SOAP_URI, SoapConstants.SOAP_BODYNAME)) {
                return false;
            }
            m_wrapper.toStart();
        } catch (JiBXException e) {
            throw new WsException("Error checking for empty SOAP Body.", e);
        }
        return true;
    }
View Full Code Here

     */
    public void startBody() throws WsException {
        try {
            m_wrapper.parsePastStartTag(SoapConstants.SOAP_URI, SoapConstants.SOAP_BODYNAME);
        } catch (JiBXException e) {
            throw new WsException("Error reading start of SOAP Body.", e);
        }
    }
View Full Code Here

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

                actor = m_wrapper.parseElementText("", SoapConstants.FAULTACTOR_NAME);
            }

            return new SoapFault(code, fault, actor);
        } catch (JiBXException e) {
            throw new WsException("Error reading start of fault.", e);
        }
    }
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.