Package org.apache.axis2.context

Examples of org.apache.axis2.context.OperationContext.addMessageContext()


      // Link the response to the request

      AxisOperation operation = SpecSpecificConstants.getWSRMOperation(Sandesha2Constants.MessageTypes.POLL_RESPONSE_MESSAGE, pollMessage.getRMSpecVersion(), pollMessage.getMessageContext().getAxisService());
      OperationContext context = new OperationContext(operation, pollMessage.getMessageContext().getServiceContext());

      context.addMessageContext(returnMessage);
      returnMessage.setServiceContext(null);
      returnMessage.setOperationContext(context);

      returnMessage.setProperty(Sandesha2Constants.MAKE_CONNECTION_RESPONSE, Boolean.TRUE);
      returnMessage.setProperty(RequestResponseTransport.TRANSPORT_CONTROL, pollMessage.getProperty(RequestResponseTransport.TRANSPORT_CONTROL));
View Full Code Here


      //The message created will basically be used as a outMessage, so setting the AxisMessage accordingly
      newMessageContext.setAxisMessage(operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE));
     
      OperationContext operationContext = OperationContextFactory.createOperationContext(operation.getAxisSpecificMEPConstant(), operation, newMessageContext.getServiceContext());
      newMessageContext.setOperationContext(operationContext);
      operationContext.addMessageContext(newMessageContext);

      // adding a blank envelope
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(referenceMessage
          .getEnvelope()));
      newMessageContext.setEnvelope(factory.getDefaultEnvelope());
View Full Code Here

        superTenantOutMessageContext.setServiceContext(serviceContext);

        AxisOperation axisOperation = axisService.getOperation(
                MultitenantConstants.MULTITENANT_DISPATCHER_OPERATION);
        OperationContext operationContext = serviceContext.createOperationContext(axisOperation);
        operationContext.addMessageContext(superTenantOutMessageContext);

        superTenantOutMessageContext.setOperationContext(operationContext);

        String transportOutName = msgContext.getTransportOut().getName();
        superTenantOutMessageContext.setTransportOut(
View Full Code Here

        if (outMsgContext != null) {
            OperationContext opCtx = outMsgContext.getOperationContext();

            if (opCtx != null) {
                opCtx.addMessageContext(outMsgContext);
                if (log.isDebugEnabled()) {
                    log.debug("Serving from the cache...");
                }
               
                Object cachedObj =
View Full Code Here

    private void handleException(MessageContext mainInMsgContext, AxisFault fault)
            throws AxisFault {
        MessageContext mainOutMsgContext =
                MessageContextBuilder.createFaultMessageContext(mainInMsgContext, fault);
        OperationContext mainOpContext = mainInMsgContext.getOperationContext();
        mainOpContext.addMessageContext(mainOutMsgContext);
        mainOutMsgContext.setOperationContext(mainOpContext);
        AxisEngine.sendFault(mainOutMsgContext);
    }

    /**
 
View Full Code Here

        try {
            SOAPEnvelope envelope = result.getResponseEnvelope();

            OperationContext opContext = msgContext.getOperationContext();
            if (opContext != null && !opContext.isComplete()) {
                opContext.addMessageContext(msgContext);
            }

            if (envelope.hasFault()) {
                AxisFault axisFault =
                        Utils.getInboundFaultFromMessageContext(msgContext);
View Full Code Here

            mc.setProperty(AddressingConstants.INCLUDE_OPTIONAL_HEADERS, Boolean.TRUE);
        }
       
        // create the operation context for myself
        OperationContext oc = sc.createOperationContext(axisOp);
        oc.addMessageContext(mc);
       
        // ship it out
        if (!block) {
            mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE);
        }
View Full Code Here

            } else {
                inMessageContext.setOperationContext(operationContext);
                inMessageContext.setServiceContext(outMessageContext.getServiceContext());
                if (!operationContext.isComplete()) {
                    operationContext.addMessageContext(inMessageContext);
                }
                AxisOperation axisOp = operationContext.getAxisOperation();
                //TODO need to handle fault case as well ,
                //TODO  need to check whether the message contains fault , if so we need to get the fault message
                AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
View Full Code Here

                        //TODO need to handle fault case as well ,
                        //TODO  need to check whether the message contains fault , if so we need to get the fault message
                        AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                        msgContext.setOperationContext(opContext);
                        msgContext.setAxisMessage(inMessage);
                        opContext.addMessageContext(msgContext);
                        msgContext.setServiceContext(opContext.getServiceContext());
                    }
                }
            }
        }
View Full Code Here

                }
                MessageUtils.putMessageOnMessageContext(responseMsgCtx.getMessage(),
                                                        axisResponseMsgCtx);

                OperationContext opCtx = axisResponseMsgCtx.getOperationContext();
                opCtx.addMessageContext(axisResponseMsgCtx);

                // If this is a fault message, we want to throw it as an
                // exception so that the transport can do the appropriate things
                if (responseMsgCtx.getMessage().isFault()) {
                   
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.