Package org.apache.axis2.context

Examples of org.apache.axis2.context.OperationContext


        getRMVersion(),
        getMsgContext().getAxisService());
    getMsgContext().setAxisOperation(ackOperation);

    ServiceContext serviceCtx = getMsgContext().getServiceContext();
    OperationContext opcontext = OperationContextFactory.createOperationContext(ackOperation.getAxisSpecificMEPConstant(), ackOperation, serviceCtx);
    opcontext.setParent(getMsgContext().getServiceContext());

    getConfigurationContext().registerOperationContext(ackRequestRMMsg.getMessageId(), opcontext);
    getMsgContext().setOperationContext(opcontext);
   
    Iterator iterator = ackRequestRMMsg.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
View Full Code Here


      setTransportProperties (returnMessage, pollMessage);
     
      // 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

    if (ackRMMsgContext.getMessageContext().getOperationContext() == null) {
      // operation context will be null when doing in a GLOBAL
      // handler.
      AxisOperation op = ackMsgContext.getAxisOperation();

      OperationContext opCtx = OperationContextFactory.createOperationContext(op.getAxisSpecificMEPConstant(), op, ackRMMsgContext.getMessageContext().getServiceContext());
      ackRMMsgContext.getMessageContext().setOperationContext(opCtx);
    }

    ackRMMsgContext.getMessageContext().setServerSide(true);
   
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

        } 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)) {
View Full Code Here

   
    // setting the Fault callback
    SandeshaListener faultCallback = (SandeshaListener) msgContext.getOptions().getProperty(
        SandeshaClientConstants.SANDESHA_LISTENER);
    if (faultCallback != null) {
      OperationContext operationContext = msgContext.getOperationContext();
      if (operationContext != null) {
        operationContext.setProperty(SandeshaClientConstants.SANDESHA_LISTENER, faultCallback);
      }
    }

    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext, configContext
        .getAxisConfiguration());
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();
        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.setServiceContext(msgCtx.getServiceContext());
        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);
            responseMessageContext.setEnvelope(resenvelope);
            syncResponseBuilt = true;
          } else {
           
          }
        } catch (AxisFault e) {
          //Cannot find a valid SOAP envelope.
          if (log.isErrorEnabled() ) {
            log.error (SandeshaMessageHelper
                .getMessage(SandeshaMessageKeys.soapEnvNotSet));
          log.error ("Caught exception", e);
          }
       
          return;
        }
       
        //If addressing is disabled we will be adding this message simply as the application response of the request message.
        Boolean addressingDisabled = (Boolean) msgCtx.getOptions().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 = responseMessageContext.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 = new OperationContext(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.propertiesToCopyFromReferenceRequestMessage);
    OperationContext referenceOpCtx = fromMessage.getOperationContext();
    MessageContext referenceRequestMessage = null;
    if (referenceOpCtx!=null)
      referenceRequestMessage=referenceOpCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
   
    if (propertiesFromRefReqMsg!=null && referenceRequestMessage!=null) {
      String value = (String) propertiesFromRefReqMsg.getValue();
      if (value!=null) {
        value = value.trim();
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.