Examples of AxisEngine


Examples of org.apache.axis2.engine.AxisEngine

                }
            }

            //if we don't do this , this guy will wait till it gets HTTP 202 in the HTTP case
            mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE);
            AxisEngine engine = new AxisEngine(cc);
            mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc);
            engine.send(mc);
        } else {
            if (block) {
                // Send the SOAP Message and receive a response
                send(mc);
                // check for a fault and return the result
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

     * @return Returns MessageContext.
     * @throws AxisFault Sends the message using a two way transport and waits for a response
     */
    protected MessageContext send(MessageContext msgctx) throws AxisFault {

        AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());

        // create the responseMessageContext
        MessageContext responseMessageContext = new MessageContext();

        // This is a hack - Needs to change
        responseMessageContext.setOptions(options);


        responseMessageContext.setServerSide(false);
        responseMessageContext.setMessageID(msgctx.getMessageID());
        addMessageContext(responseMessageContext);
        responseMessageContext.setServiceContext(msgctx.getServiceContext());
        responseMessageContext.setAxisMessage(
                axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));

        //sending the message
        engine.send(msgctx);
        responseMessageContext.setDoingREST(msgctx.isDoingREST());

        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
                .getProperty(MessageContext.TRANSPORT_IN));
        responseMessageContext.setTransportIn(msgctx.getTransportIn());
        responseMessageContext.setTransportOut(msgctx.getTransportOut());

        // Options object reused above so soapAction needs to be removed so
        // that soapAction+wsa:Action on response don't conflict
        responseMessageContext.setSoapAction("");

        if (responseMessageContext.getEnvelope() == null) {
            // If request is REST we assume the responseMessageContext is REST, so
            // set the variable
            SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
                    responseMessageContext, msgctx.getEnvelope().getNamespace()
                    .getNamespaceURI());
             if (resenvelope != null) {
                responseMessageContext.setEnvelope(resenvelope);
            } else {
                throw new AxisFault(Messages
                        .getMessage("blockingInvocationExpectsResponse"));
            }
        }
        SOAPEnvelope resenvelope = responseMessageContext.getEnvelope();
        if (resenvelope != null) {
            if (resenvelope.getBody().hasFault()) {
                SOAPFault soapFault = resenvelope.getBody().getFault();
                //we need to call engine.receiveFault
                engine = new AxisEngine(msgctx.getConfigurationContext());
                engine.receiveFault(responseMessageContext);
                if (options.isExceptionToBeThrownOnSOAPFault()) {
                    // does the SOAPFault has a detail element for Excpetion
                    throw new AxisFault(soapFault.getCode(), soapFault.getReason(),
                            soapFault.getNode(), soapFault.getRole(), soapFault.getDetail());
                }
            } else {
                engine = new AxisEngine(msgctx.getConfigurationContext());
                engine.receive(responseMessageContext);
                if (responseMessageContext.getReplyTo() != null) {
                    sc.setTargetEPR(responseMessageContext.getReplyTo());
                }
            }
        }
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

        AxisConfiguration ac = cc.getAxisConfiguration();

        try {
            rmEnabledService(cc, ac, msgCtx);

            AxisEngine ae = new AxisEngine(cc);

            ae.receive(msgCtx);

        } catch (AxisFault axisFault) {
            throw new SynapseException(axisFault);
        }
        if (shouldTrace) {
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

        // create the operation context for myself
        OperationContext oc = new OperationContext(axisOp, sc);
        oc.addMessageContext(mc);
        // ship it out
        AxisEngine engine = new AxisEngine(cc);
        if (!block) {
            mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE);
        }
        engine.send(mc);
        // all done
        completed = true;
    }
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

    public static void sendBack(org.apache.synapse.MessageContext smc) {

        MessageContext messageContext = ((Axis2MessageContext) smc).
            getAxis2MessageContext();
        AxisEngine ae = new AxisEngine(messageContext.getConfigurationContext());

        try {
            messageContext.setProperty(Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
            // check if addressing is already engaged for this message.
            // if engaged we should use the addressing enabled Configuraion context.
            ae.send(messageContext);

        } catch (AxisFault e) {
            handleException("Unexpected error during Sending message back", e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

        // if dont do this , this guy will wait till its gets HTTP 202
        // in the case
        // HTTP
        mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING,
            Boolean.TRUE);
        AxisEngine engine = new AxisEngine(cc);
        mc.getConfigurationContext().registerOperationContext(
            mc.getMessageID(), oc);
        engine.send(mc);

        // Options object reused so soapAction needs to be removed so
        // that soapAction+wsa:Action on response don't conflict
        options.setAction("");
      } else {
        if (block) {
          // Send the SOAP Message and receive a response
          MessageContext response = send(mc);
          // check for a fault and return the result
          if (response != null) {
            SOAPEnvelope resEnvelope = response.getEnvelope();
            if (resEnvelope.getBody().hasFault()) {
              SOAPFault soapFault = resEnvelope.getBody()
                  .getFault();

              // we need to call engine.receiveFault
              AxisEngine engine = new AxisEngine(mc
                  .getConfigurationContext());
              engine.receiveFault(response);
            }
          }
          completed = true;
        } else {
          sc.getConfigurationContext().getThreadPool().execute(
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

     * @return Returns MessageContext.
     * @throws AxisFault
     */
    protected MessageContext send(MessageContext msgctx) throws AxisFault {

      AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());

      // create the responseMessageContext
      MessageContext responseMessageContext = new MessageContext();

      // This is a hack - Needs to change
      responseMessageContext.setOptions(options);

      responseMessageContext.setServerSide(false);
      responseMessageContext.setMessageID(msgctx.getMessageID());
      addMessageContext(responseMessageContext);

      // sending the message
      engine.send(msgctx);

      // fix case where there is no response message (in-only)
      if (msgctx.getOperationContext().getMessageContext(
          WSDL2Constants.MESSAGE_LABEL_OUT).getProperty(
          MessageContext.TRANSPORT_IN) == null)
        return null;

      responseMessageContext.setDoingREST(msgctx.isDoingREST());

      responseMessageContext.setProperty(MessageContext.TRANSPORT_IN,
          msgctx.getProperty(MessageContext.TRANSPORT_IN));
      responseMessageContext.setTransportIn(msgctx.getTransportIn());
      responseMessageContext.setTransportOut(msgctx.getTransportOut());

      // Options object reused above so soapAction needs to be removed so
      // that soapAction+wsa:Action on response don't conflict
      responseMessageContext.setSoapAction("");

      if (responseMessageContext.getEnvelope() == null) {
        // If request is REST we assume the responseMessageContext is
        // REST, so
        // set the variable

        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
            responseMessageContext, msgctx.getEnvelope()
                .getNamespace().getNamespaceURI());
        if (resenvelope != null) {
          responseMessageContext.setEnvelope(resenvelope);
          engine = new AxisEngine(msgctx.getConfigurationContext());
          engine.receive(responseMessageContext);
          if (responseMessageContext.getReplyTo() != null) {
            sc.setTargetEPR(responseMessageContext.getReplyTo());
          }
        } else {
          throw new AxisFault(Messages
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

    public static void sendBack(org.apache.synapse.MessageContext smc) {

        MessageContext messageContext = ((Axis2MessageContext) smc).
            getAxis2MessageContext();
        AxisEngine ae = new AxisEngine(messageContext.getConfigurationContext());

        try {
            messageContext.setProperty(Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
            // check if addressing is already engaged for this message.
            // if engaged we should use the addressing enabled Configuraion context.
            ae.send(messageContext);

        } catch (AxisFault e) {
            handleException("Unexpected error during Sending message back", e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

            outMsgContext.setEnvelope(messageContext.getEnvelope());
        }

        log.debug("Executed EmptyRMMessageReceiver#receive() and Java Return for RMMediator");

        AxisEngine engine = new AxisEngine(
                messageContext.getOperationContext().getServiceContext().getConfigurationContext());
        engine.send(outMsgContext);

    }
View Full Code Here

Examples of org.apache.axis2.engine.AxisEngine

                // investigation seems like a woodstox issue. Use hack for now
                //axisOutMsgContext.getEnvelope().build();
               
                log.debug("Reply Body : \n" + axisOutMsgContext.getEnvelope());

                AxisEngine ae = new AxisEngine(axisOutMsgContext.getConfigurationContext());
                try {
                    axisOutMsgContext.setProperty(
                            org.apache.synapse.Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
                    mc.getOperationContext().setProperty(
                            Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
                    // check for addressing is alredy engaged for this message.
                    // if engage we should use the address enable Configuraion context.
                    ae.send(axisOutMsgContext);

                } catch (AxisFault e) {
                    log.error("Axis fault encountered while forwarding message to endpoint : "
                            + targetEndpoint, e);
                }
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.