Package org.apache.axis2.context

Examples of org.apache.axis2.context.OperationContext


    // adding the SANDESHA_LISTENER
    SandeshaListener faultCallback = (SandeshaListener) msgCtx.getOptions().getProperty(
        SandeshaClientConstants.SANDESHA_LISTENER);
    if (faultCallback != null) {
      OperationContext operationContext = msgCtx.getOperationContext();
      if (operationContext != null) {
        operationContext.setProperty(SandeshaClientConstants.SANDESHA_LISTENER, faultCallback);
      }
    }
    if (log.isDebugEnabled())
      log.debug("Exit: CreateSeqMsgProcessor::processOutMessage " + Boolean.FALSE);
    return false;
View Full Code Here


     
      //set the LastMessageAction and the property
      if (outMessageContext.getOptions()==null)
        outMessageContext.setOptions(new Options ());
     
      OperationContext operationContext = outMessageContext.getOperationContext();
      String inboundSequenceId = (String) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
      operationContext.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID,
          inboundSequenceId);
     
      Long inboundMSgNo = (Long) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_MESSAGE_NUMBER);
      operationContext.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_MESSAGE_NUMBER,
          inboundMSgNo);
     
      outMessageContext.getOptions().setAction(Sandesha2Constants.SPEC_2005_02.Actions.ACTION_LAST_MESSAGE);

      //says that the inbound msg of this was a LastMessage - so the new msg will also be a LastMessage
View Full Code Here

    AxisOperation terminateOp = SpecSpecificConstants.getWSRMOperation(
        Sandesha2Constants.MessageTypes.TERMINATE_SEQ,
        rmMsgCtx.getRMSpecVersion(),
        getMsgContext().getAxisService());
 
    OperationContext opcontext = OperationContextFactory.createOperationContext(terminateOp.getAxisSpecificMEPConstant(), terminateOp, getMsgContext().getServiceContext());
    opcontext.setParent(getMsgContext().getServiceContext());

    getConfigurationContext().registerOperationContext(rmMsgCtx.getMessageId(),  opcontext);

    getMsgContext().setOperationContext(opcontext);
    getMsgContext().setAxisOperation(terminateOp);
View Full Code Here

      secManager.checkProofOfPossession(token, seqHeader, msgCtx);
      secManager.checkProofOfPossession(token, body, msgCtx);
    }
   
    // Store the inbound sequence id, number and lastMessage onto the operation context
    OperationContext opCtx = msgCtx.getOperationContext();
    if(opCtx != null) {
      opCtx.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID, sequenceId);
      opCtx.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_MESSAGE_NUMBER, new Long(msgNo));
      if(lastMessage) opCtx.setProperty(Sandesha2Constants.MessageContextProperties.INBOUND_LAST_MESSAGE, Boolean.TRUE);
    }
   
    // setting acked msg no range
    ConfigurationContext configCtx = rmMsgCtx.getMessageContext().getConfigurationContext();
    if (configCtx == null) {
View Full Code Here

        } else {
            throw new UnsupportedOperationException("[" + request.getMethod() + " ] method not supported");
        }

        // Finalize response
        OperationContext operationContext = msgContext.getOperationContext();
        Object contextWritten = null;
        Object isTwoChannel = null;
        if (operationContext != null) {
            contextWritten = operationContext.getProperty(Constants.RESPONSE_WRITTEN);
            isTwoChannel = operationContext.getProperty(Constants.DIFFERENT_EPR);
        }

        if ((contextWritten != null) && Constants.VALUE_TRUE.equals(contextWritten)) {
            if ((isTwoChannel != null) && Constants.VALUE_TRUE.equals(isTwoChannel)) {
                response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
View Full Code Here

      // will hopefully pick it up soon.
      Boolean makeConnection = (Boolean) msgCtx.getProperty(Sandesha2Constants.MAKE_CONNECTION_RESPONSE);
      EndpointReference toEPR = msgCtx.getTo();

      MessageContext inMsg = null;
      OperationContext op = msgCtx.getOperationContext();
     
      RequestResponseTransport t = (RequestResponseTransport) msgCtx.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
     
      if (t==null) {
        if (op != null)
          inMsg = op.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        if (inMsg != null)
          t = (RequestResponseTransport) inMsg.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
      }

      // If we are anonymous, and this is not a makeConnection, then we must have a transport waiting
View Full Code Here

     
      if (responseMessageContext==null || responseMessageContext.getEnvelope()==null) {
        if (responseMessageContext==null)
          responseMessageContext = new MessageContext();

        OperationContext requestMsgOpCtx = msgCtx.getOperationContext();
        //copy any necessary properties
        SandeshaUtil.copyConfiguredProperties(msgCtx, responseMessageContext);
        // If the request operation context is Out-In then it's reasonable to assume
        // that the response is related to the request.
        //int mep = requestMsgOpCtx.getAxisOperation().getAxisSpecificMEPConstant();
        //if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
          //this line causes issues in addressing
          //responseMessageContext.setOperationContext(requestMsgOpCtx);
        //}
        responseMessageContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, requestMsgOpCtx
                .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING));
        responseMessageContext.setProperty(Constants.Configuration.CONTENT_TYPE, requestMsgOpCtx
                .getProperty(Constants.Configuration.CONTENT_TYPE));
        responseMessageContext.setProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE, requestMsgOpCtx
                .getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE));

        //If the response MsgCtx was not available Axis2 would hv put the transport info into a
        //HashMap, getting the data from it.
        HashMap transportInfoMap = (HashMap) msgCtx.getProperty(Constants.Configuration.TRANSPORT_INFO_MAP);
        if (transportInfoMap != null) {
          responseMessageContext.setProperty(Constants.Configuration.CONTENT_TYPE,
                  transportInfoMap.get(Constants.Configuration.CONTENT_TYPE));
          responseMessageContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
                  transportInfoMap.get(Constants.Configuration.CHARACTER_SET_ENCODING));
        }
     
        responseMessageContext.setConfigurationContext(msgCtx.getConfigurationContext());
        responseMessageContext.setTransportIn(msgCtx.getTransportIn());
        responseMessageContext.setTransportOut(msgCtx.getTransportOut());
        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgCtx
            .getProperty(MessageContext.TRANSPORT_IN));
       
        responseMessageContext.setServiceGroupContext(msgCtx.getServiceGroupContext());

        responseMessageContext.setProperty(Sandesha2Constants.MessageContextProperties.MAKECONNECTION_ENTRY,
        msgCtx.getProperty(Sandesha2Constants.MessageContextProperties.MAKECONNECTION_ENTRY));

        // If request is REST we assume the responseMessageContext is REST,
        // so set the variable

        responseMessageContext.setDoingREST(msgCtx.isDoingREST());

        resenvelope = responseMessageContext.getEnvelope();
        try {
          // MessageContext is modified in TransportUtils.createSOAPMessage(). It might be used by axis.engine or handler.
          // To catch the modification and pass it to engine or handler, resenvelope is created by responseMessageContext.
          if (resenvelope==null) {
            //We try to build the response out of the transport stream.
            resenvelope = TransportUtils.createSOAPMessage(responseMessageContext, true);
            responseMessageContext.setEnvelope(resenvelope);
            syncResponseBuilt = true;
          }
        } catch (AxisFault e) {
          //Cannot find a valid SOAP envelope.
          if (log.isDebugEnabled() ) {
            log.debug (SandeshaMessageHelper
                .getMessage(SandeshaMessageKeys.soapEnvNotSet));
          log.debug ("Caught exception", e);
          }
       
          return;
        }
       
        //we will not be setting the operation context here since this msgs may not be an application reply.
        //we let other dispatchers find it.
        int messageType = MsgInitializer.initializeMessage(responseMessageContext).getMessageType();
        RMMsgContext responseRMMessage = MsgInitializer.initializeMessage(responseMessageContext);
        int responseMessageType = responseRMMessage.getMessageType();
        if(log.isDebugEnabled()) log.debug("inboundMsgType" + responseMessageType + "outgoing message type " + messageType);
                
        //Setting the AxisService object
        responseMessageContext.setAxisService(msgCtx.getAxisService());

        //If addressing is disabled we will be adding this message simply as the application response of the request message.
        Boolean addressingDisabled = (Boolean) msgCtx.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        if (addressingDisabled!=null && Boolean.TRUE.equals(addressingDisabled)) {
          // If the AxisOperation object doesn't have a message receiver, it means that this was
          // an out only op where we have added an ACK to the response.  Set the requestMsgOpCtx to
          // be the RMIn
          OperationContext responseMsgOpCtx = requestMsgOpCtx;
          if (requestMsgOpCtx.getAxisOperation().getMessageReceiver() == null) {
            // Generate a new RM In Only operation

            ServiceContext serviceCtx = msgCtx.getServiceContext();
            AxisOperation op = msgCtx.getAxisService().getOperation(Sandesha2Constants.RM_IN_ONLY_OPERATION);
View Full Code Here

      newMessageContext.setAxisOperation(operation);

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

        }
      }
    }
   
    Parameter propertiesFromRefReqMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessageAsStringArray);
    OperationContext referenceOpCtx = fromMessage.getOperationContext();
    MessageContext referenceRequestMessage = null;
    if (referenceOpCtx!=null)
      referenceRequestMessage=referenceOpCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
   
    if (propertiesFromRefReqMsg!=null && referenceRequestMessage!=null) {
      String[] propertyNames = (String[]) propertiesFromRefReqMsg.getValue();
      if (propertyNames!=null) {
        for (int i=0;i<propertyNames.length;i++) {
View Full Code Here

     * whenever performance is important.
     *
     * @throws AxisFault
     */
    public void cleanupTransport() throws AxisFault {
        final OperationContext lastOperationContext = getLastOperationContext();
        if (lastOperationContext != null) {
            MessageContext outMessageContext =
                    lastOperationContext
                            .getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            if (outMessageContext != null) {
                if (outMessageContext.getTransportOut() != null &&
                        outMessageContext.getTransportOut().getSender() != null) {
                    outMessageContext.getTransportOut().getSender().cleanup(outMessageContext);
View Full Code Here

TOP

Related Classes of org.apache.axis2.context.OperationContext

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.