Package org.jibx.ws.context

Examples of org.jibx.ws.context.OutContext


    private Processor getProcessor() throws WsException {
        if (m_processor != null) {
            m_processor.reset();
        }
        if (m_processor == null || isModified()) {
            m_outCtx = new OutContext();
            if (getBodyWriter() != null) {
                m_outCtx.setBodyWriter(getBodyWriter());
            }

            m_inCtx = new InContext();
View Full Code Here


     * @return exchange context based on the service definition
     * @throws WsException on error creating exchange context, for example handler object cannot be created
     */
    private ExchangeContext createExchangeContext(ServiceDefinition sdef) throws WsException {
        InContext inCtx = new InContext();
        OutContext outCtx = new OutContext();

        createBodyHandlers(inCtx, outCtx);
        createHeaderHandlers(sdef, outCtx, inCtx);
        setContextOnTransportOptions(inCtx, outCtx);

View Full Code Here

            throw new IllegalStateException("No message context available for sending message");
        }
        if (!m_exchangeCtx.getCurrentMessageContext().isOutbound()) {
            throw new IllegalStateException("Cannot send message when current message context is inbound");
        }
        OutContext context = (OutContext) m_exchangeCtx.getCurrentMessageContext();

        try {
            logger.debug("Starting send message");
            context.invokeBodyWriter(conn.getNormalWriter(DEFAULT_NS));
            logger.debug("Message sent");
        } finally {
            conn.outputComplete();
            conn.close();
        }
View Full Code Here

            throw new IllegalStateException("No message context available for sending message");
        }
        if (!m_exchangeCtx.getCurrentMessageContext().isOutbound()) {
            throw new IllegalStateException("Cannot send message when current message context is inbound");
        }
        OutContext context = (OutContext) m_exchangeCtx.getCurrentMessageContext();
      
        SoapWriter soapWriter = new SoapWriter(conn);

        boolean requestCompleted = false;
        try {
            logger.debug("Starting send message");
            soapWriter.startMessage(m_encodingStyle);
            IXMLWriter xmlWriter = soapWriter.getWriter();
            if (context.hasHandlers(SoapPhase.HEADER)) {
                soapWriter.startHeader();
                context.invokeHandlers(SoapPhase.HEADER, xmlWriter);
                soapWriter.endHeader();
            }
            soapWriter.startBody();
            context.invokeBodyWriter(xmlWriter);
            logger.debug("Ending send message body");
            soapWriter.endBody();
            soapWriter.sendMessageCompletely();
            logger.debug("Message sent");
            requestCompleted = true;
View Full Code Here

            throw new IllegalStateException("No message context available for sending fault message");
        }
        if (!m_exchangeCtx.getCurrentMessageContext().isOutbound()) {
            throw new IllegalStateException("Cannot send fault message when current message context is inbound");
        }
        OutContext context = (OutContext) m_exchangeCtx.getCurrentMessageContext();

        SoapWriter soapWriter = new SoapWriter(conn);

        boolean requestCompleted = false;
View Full Code Here

    private Processor getProcessor() throws WsException {
        if (m_processor != null) {
            m_processor.reset();
        }
        if (m_processor == null || isModified()) {
            m_outCtx = new OutContext();
            if (m_outHeaderHandlers != null) {
                for (Iterator iter = m_outHeaderHandlers.iterator(); iter.hasNext();) {
                    OutHandler handler = (OutHandler) iter.next();
                    m_outCtx.addHandler(SoapPhase.HEADER, handler);
                }
View Full Code Here

     *
     * @param iconn the connection that the request is to be read from
     * @param oconn the connection that the response is to written to
     */
    public final void processRequest(InConnection iconn, OutServerConnection oconn) {
        OutContext outCtx = null;
        try {
            getProcessor().receiveMessage(iconn);
            Object body = getProcessor().getCurrentMessageContext().getBody();

            try {
                Object response = invokeOperation(body);

                getProcessor().switchMessageContext();
                if (logger.isDebugEnabled()) {
                    logger.debug("Sending response " + response);
                }
                outCtx = (OutContext) getProcessor().getCurrentMessageContext();
                outCtx.setBody(response);
                getProcessor().sendMessage(oconn);
            } catch (NoSuchMethodException e) {
                oconn.sendNotFoundError();
            }
        } catch (Throwable e) {
View Full Code Here

     * @return exchange context based on the service definition
     * @throws WsException on error creating exchange context, for example handler object cannot be created
     */
    private ExchangeContext createExchangeContext() throws WsException {
        InContext inCtx = new InContext();
        OutContext outCtx = new OutContext();

        createBodyHandlers(inCtx, outCtx);
        setContextOnTransportOptions(inCtx, outCtx);

        return ExchangeContext.createInOutExchange(inCtx, outCtx);
View Full Code Here

    private SoapProcessor m_processor;

    protected void setUp() throws Exception {
        StubbedChannel.getInstance().close();
        m_outBodyHandler = new MarshallingPayloadWriter(Person.class);
        OutContext outCtx = new OutContext();
        outCtx.setBodyWriter(m_outBodyHandler);

        UnmarshallingPayloadReader inBodyHandler = new UnmarshallingPayloadReader(Customer.class);
        InContext inCtx = new InContext();
        inCtx.setBodyReader(inBodyHandler);
View Full Code Here

    private InContext m_inCtx;

    protected void setUp() throws Exception {
        StubbedChannel.getInstance().close();
        m_outBodyHandler = new MarshallingPayloadWriter(Person.class);
        OutContext outCtx = new OutContext();
        outCtx.setBodyWriter(m_outBodyHandler);

        UnmarshallingPayloadReader inBodyHandler = new UnmarshallingPayloadReader(Customer.class);
        m_inCtx = new InContext();
        m_inCtx.setBodyReader(inBodyHandler);
        m_OutInProcessor = (SoapProcessor) SoapProtocol.SOAP1_1.createProcessor(ExchangeContext.createOutInExchange(outCtx, m_inCtx));
View Full Code Here

TOP

Related Classes of org.jibx.ws.context.OutContext

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.