Package org.apache.axis2.addressing

Examples of org.apache.axis2.addressing.EndpointReference


        OMElement body = msgcontext.getEnvelope().getBody();
        secManager.checkProofOfPossession(token, body, msgcontext);
      }
 
      //if toAddress is RMAnon we may need to terminate the request side sequence here.
      EndpointReference toEPR = createSeqMsg.getTo();
      if (toEPR.hasAnonymousAddress()) {
 
        RMSBean findBean = new RMSBean ();
        findBean.setReplyToEPR(toEPR.getAddress());
        findBean.setTerminationPauserForCS(true);
       
        //TODO recheck
        RMSBean rmsBean = storageManager.getRMSBeanMgr().findUnique(findBean);
        if (rmsBean!=null) {         
          //AckManager hs not done the termination. Do the termination here.
          MessageContext requestSideRefMessage = storageManager.retrieveMessageContext(rmsBean.getReferenceMessageStoreKey(),context);
          if (requestSideRefMessage==null) {
            FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg,
                SandeshaMessageHelper.getMessage(SandeshaMessageKeys.referencedMessageNotFound, rmsBean.getInternalSequenceID()),
                new Exception());           
            // Return false if an Exception hasn't been thrown.
            if (log.isDebugEnabled())
              log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
            return false;
          }
         
          RMMsgContext requestSideRefRMMessage = MsgInitializer.initializeMessage(requestSideRefMessage);
          TerminateManager.addTerminateSequenceMessage(requestSideRefRMMessage, rmsBean.getInternalSequenceID(), rmsBean.getSequenceID(), storageManager);
        }
      }
       

      MessageContext outMessage = null;
 
      // Create the new sequence id, as well as establishing the beans that handle the
      // sequence state.
      RMDBean rmdBean = SequenceManager.setupNewSequence(createSeqRMMsg, storageManager, secManager, token);
       
      RMMsgContext createSeqResponse = RMMsgCreator.createCreateSeqResponseMsg(createSeqRMMsg, rmdBean);
      outMessage = createSeqResponse.getMessageContext();
      // Set a message ID for this Create Sequence Response message
      outMessage.setMessageID(SandeshaUtil.getUUID());
       
      createSeqResponse.setFlow(MessageContext.OUT_FLOW);
 
      // for making sure that this won't be processed again
      createSeqResponse.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
     
      CreateSequenceResponse createSeqResPart = (CreateSequenceResponse) createSeqResponse
          .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
 
        // OFFER PROCESSING
      SequenceOffer offer = createSeqPart.getSequenceOffer();
      if (offer != null) {
        Accept accept = createSeqResPart.getAccept();
        if (accept == null) {
          if (log.isDebugEnabled())
            log.debug(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart));
          FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg,
                                                      SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart),
                                                      new Exception());
          // Return false if an Exception hasn't been thrown.
          if (log.isDebugEnabled())
            log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
          return false;
        }
 
        // offered seq id
        String offeredSequenceID = offer.getIdentifer().getIdentifier();
       
        boolean offerEcepted = offerAccepted(offeredSequenceID, context, createSeqRMMsg, storageManager);
 
        if (offerEcepted) {
          // Setting the CreateSequence table entry for the outgoing
          // side.
          RMSBean rMSBean = new RMSBean();
          rMSBean.setSequenceID(offeredSequenceID);
          String outgoingSideInternalSequenceId = SandeshaUtil
              .getOutgoingSideInternalSequenceID(rmdBean.getSequenceID());
          rMSBean.setInternalSequenceID(outgoingSideInternalSequenceId);
          // this is a dummy value
          rMSBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
           
          rMSBean.setToEPR(rmdBean.getToEPR());
          rMSBean.setAcksToEPR(rmdBean.getToEPR())// The acks need to flow back into this endpoint
          rMSBean.setReplyToEPR(rmdBean.getReplyToEPR());
          rMSBean.setLastActivatedTime(System.currentTimeMillis());
          rMSBean.setRMVersion(rmdBean.getRMVersion());
          rMSBean.setClientCompletedMessages(new RangeString());
 
          // Setting sequence properties for the outgoing sequence.
          // Only will be used by the server side response path. Will
          // be wasted properties for the client side.
           
          Endpoint endpoint = offer.getEndpoint();
          if (endpoint!=null) {
            // setting the OfferedEndpoint
            rMSBean.setOfferedEndPoint(endpoint.getEPR().getAddress());
          }
   
          rmdBean.setOutboundInternalSequence(outgoingSideInternalSequenceId);
          RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
          rmdBeanMgr.update(rmdBean);
 
          // Store the inbound token (if any) with the new sequence
          rMSBean.setSecurityTokenData(rmdBean.getSecurityTokenData());
         
          // If this new sequence has anonymous acksTo, then we must poll for the acks
          // If the inbound sequence is targetted at the WSRM anonymous URI, we need to start
          // polling for this sequence.
          String acksTo = rMSBean.getAcksToEPR();
          EndpointReference reference = new EndpointReference(acksTo);
          if ((acksTo == null || reference.hasAnonymousAddress()) &&
            Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqRMMsg.getRMSpecVersion())) {
            rMSBean.setPollingMode(true);
          }
         
          // Set the SOAP Version for this sequence.
          rMSBean.setSoapVersion(SandeshaUtil.getSOAPVersion(createSeqRMMsg.getSOAPEnvelope()));

          storageManager.getRMSBeanMgr().insert(rMSBean);
         
          SandeshaUtil.startWorkersForSequence(context, rMSBean);
         
        } else {
          // removing the accept part.
          createSeqResPart.setAccept(null);
          createSeqResponse.addSOAPEnvelope();
        }
      }
             
      //TODO add createSequenceResponse message as the referenceMessage to the RMDBean.
 
      outMessage.setResponseWritten(true);
 
      rmdBean.setLastActivatedTime(System.currentTimeMillis());
     
      // If the inbound sequence is targetted at the anonymous URI, we need to start
      // polling for this sequence.
      if (toEPR.hasAnonymousAddress()) {
        if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqRMMsg.getRMSpecVersion())) {
          rmdBean.setPollingMode(true);
        }
      }
     
      storageManager.getRMDBeanMgr().update(rmdBean);
 
      SandeshaUtil.startWorkersForSequence(context, rmdBean);

      //
      // We have done all of our updates, so commit the transaction
      if(transaction != null && transaction.isActive()) transaction.commit();
     
      AxisEngine engine = new AxisEngine(context);
      try{
        engine.send(outMessage);       
      }
      catch(AxisFault e){
        FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg,
            SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotSendCreateSeqResponse,
                                             SandeshaUtil.getStackTraceFromException(e)), e);
        // Return false if an Exception hasn't been thrown.
        if (log.isDebugEnabled())
          log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
        return false;
      }
 
      EndpointReference replyTo = createSeqMsg.getReplyTo();
      if(replyTo == null || replyTo.hasAnonymousAddress()) {
        createSeqMsg.getOperationContext().setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN, "true");
      } else {
        createSeqMsg.getOperationContext().setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN, "false");
      }
     
View Full Code Here


    ServiceClient serviceClient = new ServiceClient (configContext,null)
   
    Options clientOptions = new Options ();
   
    clientOptions.setTo(new EndpointReference (toEPR));
   
//    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress() + "/" + ServiceClient.ANON_OUT_IN_OP;
//    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
//    clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
   
    String sequenceKey = SandeshaUtil.getUUID()//sequence key for thie sequence.
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    clientOptions.setReplyTo(new EndpointReference (AddressingConstants.Submission.WSA_ANONYMOUS_URL));
   
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
   
    clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
   
View Full Code Here

      MessageContext faultContext = MessageContextBuilder.createFaultMessageContext(inMsgContext, e);
      // Copy some of the parameters to the new message context.
      faultContext.setProperty(Constants.Configuration.CONTENT_TYPE, inMsgContext
          .getProperty(Constants.Configuration.CONTENT_TYPE));

      EndpointReference faultEPR = inRMMsgContext.getFaultTo();
      if (faultEPR==null)
        faultEPR = inRMMsgContext.getReplyTo();
     
      //we handler the WSRM Anon InOut scenario differently here
      if (Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(inRMMsgContext.getRMSpecVersion())
          && (faultEPR==null || faultEPR.hasAnonymousAddress())) {
        RequestResponseTransport requestResponseTransport = (RequestResponseTransport) inRMMsgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
       
        //this will cause the fault to be thrown out of thread waiting on this transport object.
        AxisFault fault = new AxisFault ("Sandesha2 got a fault when doing the invocation", faultContext);
        if (requestResponseTransport!=null)
View Full Code Here

   
    String axis2_xml = CLIENT_REPO_PATH + File.separator + "client_axis2.xml";
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,axis2_xml);
   
    Options clientOptions = new Options ();
    clientOptions.setTo(new EndpointReference (toEPR));

    ServiceClient serviceClient = new ServiceClient (configContext,null);
    clientOptions.setAction("urn:wsrm:Ping");
    serviceClient.setOptions(clientOptions);
   
View Full Code Here

    String axis2_xml = CLIENT_REPO_PATH + File.separator +"client_axis2.xml";
        ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO_PATH,axis2_xml);
    ServiceClient serviceClient = new ServiceClient (configContext,null)
   
    Options clientOptions = new Options ();
    clientOptions.setTo(new EndpointReference (toEPR));
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);
    serviceClient.setOptions(clientOptions);

    Callback callback1 = new TestCallback ("Callback 1");
View Full Code Here

      }

      internalSequenceId = SandeshaUtil.getOutgoingSideInternalSequenceID(inboundSequence);
    } else {
      // set the internal sequence id for the client side.
      EndpointReference toEPR = msgContext.getTo();
      if (toEPR == null || toEPR.getAddress() == null || "".equals(toEPR.getAddress())) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.toEPRNotValid, null);
        log.debug(message);
        throw new SandeshaException(message);
      }

      String to = toEPR.getAddress();
      String sequenceKey = (String) msgContext.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
      internalSequenceId = SandeshaUtil.getInternalSequenceID(to, sequenceKey);

      String lastAppMessage = (String) msgContext.getProperty(SandeshaClientConstants.LAST_MESSAGE);
      if (lastAppMessage != null && "true".equals(lastAppMessage))
        lastMessage = true;
    }
   
    if (internalSequenceId!=null)
      rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceId);

    /*
     * checking weather the user has given the messageNumber (most of the
     * cases this will not be the case where the system will generate the
     * message numbers
     */

    // User should set it as a long object.
    Long messageNumberLng = (Long) msgContext.getProperty(SandeshaClientConstants.MESSAGE_NUMBER);

    long givenMessageNumber = -1;
    if (messageNumberLng != null) {
      givenMessageNumber = messageNumberLng.longValue();
      if (givenMessageNumber <= 0) {
        throw new SandeshaException(SandeshaMessageHelper.getMessage(
            SandeshaMessageKeys.msgNumberMustBeLargerThanZero, Long.toString(givenMessageNumber)));
      }
    }

    // A dummy message is a one which will not be processed as a actual
    // application message.
    // The RM handlers will simply let these go.
    String dummyMessageString = (String) msgContext.getOptions().getProperty(SandeshaClientConstants.DUMMY_MESSAGE);
    boolean dummyMessage = false;
    if (dummyMessageString != null && Sandesha2Constants.VALUE_TRUE.equals(dummyMessageString))
      dummyMessage = true;

    RMSBean rmsBean = SandeshaUtil.getRMSBeanFromInternalSequenceId(storageManager, internalSequenceId);

    //see if the sequence is closed
    if(rmsBean != null && rmsBean.isSequenceClosedClient()){
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSendMsgAsSequenceClosed, internalSequenceId));
    }

    //see if the sequence is terminated
    if(rmsBean != null && rmsBean.isTerminateAdded()) {
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSendMsgAsSequenceTerminated, internalSequenceId));
    }

    //see if the sequence is timed out
    if(rmsBean != null && rmsBean.isTimedOut()){
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSendMsgAsSequenceTimedout, internalSequenceId));
    }
   
    // If the call application is a 2-way MEP, and uses a anonymous replyTo, and the
    // RM 1.1 spec level, then we must have MakeConnection enabled. We check that here,
    // before we start creating a new Sequence.
    if(!serverSide) {
      AxisOperation op = msgContext.getAxisOperation();
      int mep = WSDLConstants.MEP_CONSTANT_INVALID;
      if(op != null) {
        mep = op.getAxisSpecifMEPConstant();
      }
      if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
        String specVersion = null;
        if(rmsBean == null) {
          specVersion = SequenceManager.getSpecVersion(msgContext, storageManager);
        } else {
          specVersion = rmsBean.getRMVersion();
        }
        if(specVersion == Sandesha2Constants.SPEC_VERSIONS.v1_1) {
          SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configContext.getAxisConfiguration());
          if(!policy.isEnableMakeConnection()) {
            String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionDisabled);
            throw new SandeshaException(message);
          }
        }
      }
    }

    //setting the reference msg store key.
    if (rmsBean!=null && rmsBean.getReferenceMessageStoreKey()==null) {
      //setting this application message as the reference, if it hsnt already been set.
     
      String referenceMsgKey = SandeshaUtil.getUUID();
      storageManager.storeMessageContext(referenceMsgKey, msgContext);
      rmsBean.setReferenceMessageStoreKey(referenceMsgKey);
    }
   
    String outSequenceID = null;

    if (rmsBean == null) {
      // SENDING THE CREATE SEQUENCE.
      synchronized (RMSBeanMgr.class) {
        // There is a timing window where 2 sending threads can hit this point
        // at the same time and both will create an RMSBean to the same endpoint
        // with the same internal sequenceid
        // Check that someone hasn't created the bean
        rmsBean = SandeshaUtil.getRMSBeanFromInternalSequenceId(storageManager, internalSequenceId);
       
        // if first message - setup the sending side sequence - both for the
        // server and the client sides.
        if (rmsBean == null) {
          rmsBean = SequenceManager.setupNewClientSequence(msgContext, internalSequenceId, storageManager);
          rmsBean = addCreateSequenceMessage(rmMsgCtx, rmsBean, storageManager);
        }
      }
   
    } else {
      outSequenceID = rmsBean.getSequenceID();
    }
   
    // the message number that was last used.
    long systemMessageNumber = rmsBean.getNextMessageNumber();

    // The number given by the user has to be larger than the last stored
    // number.
    if (givenMessageNumber > 0 && givenMessageNumber <= systemMessageNumber) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.msgNumberNotLargerThanLastMsg, Long
          .toString(givenMessageNumber));
      throw new SandeshaException(message);
    }

    // Finding the correct message number.
    long messageNumber = -1;
    if (givenMessageNumber > 0) // if given message number is valid use it.
                  // (this is larger than the last stored due
                  // to the last check)
      messageNumber = givenMessageNumber;
    else if (systemMessageNumber > 0) { // if system message number is valid
                      // use it.
      messageNumber = systemMessageNumber + 1;
    } else { // This is the first message (systemMessageNumber = -1)
      messageNumber = 1;
    }

    if (serverSide) {
      // Deciding whether this is the last message. We assume it is if it relates to
      // a message which arrived with the LastMessage flag on it.
      RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, inboundSequence);     
      // Get the last in message
      String lastRequestId = rmdBean.getLastInMessageId();
      RelatesTo relatesTo = msgContext.getRelatesTo();
      if(relatesTo != null && lastRequestId != null &&
          lastRequestId.equals(relatesTo.getValue())) {
        lastMessage = true;
      }
     
      //or a constant property may call it as the last msg
      Boolean inboundLast = (Boolean) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_LAST_MESSAGE);
      if (inboundLast!=null && inboundLast.booleanValue())
        lastMessage = true;
    }
   
    if (lastMessage)
      rmsBean.setLastOutMessage(messageNumber);   

    // set this as the response highest message.
    rmsBean.setHighestOutMessageNumber(messageNumber);
   
    // saving the used message number, and the expected reply count
    boolean startPolling = false;
    if (!dummyMessage) {
      rmsBean.setNextMessageNumber(messageNumber);

      // Identify the MEP associated with the message.
      AxisOperation op = msgContext.getAxisOperation();
      int mep = WSDLConstants.MEP_CONSTANT_INVALID;
      if(op != null) {
        mep = op.getAxisSpecifMEPConstant();
      }

      if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
        // We only match up requests and replies when we are doing sync interactions
        EndpointReference replyTo = msgContext.getReplyTo();
        if(replyTo == null || replyTo.hasAnonymousAddress()) {
          long expectedReplies = rmsBean.getExpectedReplies();
          rmsBean.setExpectedReplies(expectedReplies + 1);
        }

        // If we support the RM anonymous URI then rewrite the ws-a anon to use the RM equivalent.
        //(do should be done only for WSRM 1.1)
       
        if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(rmMsgCtx.getRMSpecVersion())) {
          String oldAddress = (replyTo == null) ? null : replyTo.getAddress();
          EndpointReference newReplyTo = SandeshaUtil.rewriteEPR(rmsBean, msgContext
              .getReplyTo(), configContext);
          String newAddress = (newReplyTo == null) ? null : newReplyTo.getAddress();
          if (newAddress != null && !newAddress.equals(oldAddress)) {
            // We have rewritten the replyTo. If this is the first message that we have needed to
            // rewrite then we should set the sequence up for polling, and once we have saved the
            // changes to the sequence then we can start the polling thread.
            msgContext.setReplyTo(newReplyTo);
            if (!rmsBean.isPollingMode()) {
              rmsBean.setPollingMode(true);
              startPolling = true;
            }
          }
        }
      }
    }
   
    RelatesTo relatesTo = msgContext.getRelatesTo();
    if(relatesTo != null) {
      rmsBean.setHighestOutRelatesTo(relatesTo.getValue());
    }

    // setting async ack endpoint for the server side. (if present)
    if (serverSide) {
      if (rmsBean.getToEPR() != null) {
        msgContext.setProperty(SandeshaClientConstants.AcksTo, rmsBean.getToEPR());
      }
    }

    // Update the rmsBean
    storageManager.getRMSBeanMgr().update(rmsBean);
   
    if(startPolling) {
      SandeshaUtil.startWorkersForSequence(msgContext.getConfigurationContext(), rmsBean);
    }
   
    SOAPEnvelope env = rmMsgCtx.getSOAPEnvelope();
    if (env == null) {
      SOAPEnvelope envelope = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(env))
          .getDefaultEnvelope();
      rmMsgCtx.setSOAPEnvelop(envelope);
    }

    SOAPBody soapBody = rmMsgCtx.getSOAPEnvelope().getBody();
    if (soapBody == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.soapBodyNotPresent);
      log.debug(message);
      throw new SandeshaException(message);
    }

    String messageId1 = SandeshaUtil.getUUID();
    if (rmMsgCtx.getMessageId() == null) {
      rmMsgCtx.setMessageId(messageId1);
    }

    EndpointReference toEPR = msgContext.getTo();

   
    if (toEPR != null) {
      // setting default actions.
      String to = toEPR.getAddress();
      String operationName = msgContext.getOperationContext().getAxisOperation().getName().getLocalPart();
      if (msgContext.getWSAAction() == null) {
        msgContext.setWSAAction(to + "/" + operationName);
      }
      if (msgContext.getSoapAction() == null) {
View Full Code Here

    createSeqEntry.setInternalSequenceID(rmsBean.getInternalSequenceID());
    // this will be set to true in the sender
    createSeqEntry.setSend(true);
    // Indicate that this message is a create sequence
    createSeqEntry.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    EndpointReference to = createSeqRMMessage.getTo();
    if (to!=null)
      createSeqEntry.setToAddress(to.getAddress());
    // If this message is targetted at an anonymous address then we must not have a transport
    // ready for it, as the create sequence is not a reply.
    if(to == null || to.hasAnonymousAddress())
      createSeqEntry.setTransportAvailable(false);

    createSeqMsg.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
   
    SandeshaUtil.executeAndStore(createSeqRMMessage, createSequenceMessageStoreKey);
View Full Code Here

      // Send will be set to true at the sender.
      msg.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE, Sandesha2Constants.VALUE_TRUE);
      appMsgEntry.setSequenceID(outSequenceID);
    }
   
    EndpointReference to = rmMsg.getTo();
    if (to!=null)
      appMsgEntry.setToAddress(to.getAddress());
   
    appMsgEntry.setInternalSequenceID(internalSequenceId);

    msg.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
View Full Code Here

    String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
   
    Options clientOptions = new Options ()
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
    clientOptions.setTo(new EndpointReference (toEPR));
   
    String sequenceKey = SandeshaUtil.getUUID();// "sequence2";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
     
//    clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
View Full Code Here

      // If we are sending to the anonymous URI then we _must_ have a transport waiting,
      // or the message can't go anywhere. If there is nothing here then we leave the
      // message in the sender queue, and a MakeConnection (or a retransmitted request)
      // 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
      if((toEPR==null || toEPR.hasAnonymousAddress()) &&
         (makeConnection == null || !makeConnection.booleanValue()) &&
         (t != null && !t.getStatus().equals(RequestResponseTransportStatus.WAITING))) {
       
        // Mark this sender bean so that we know that the transport is unavailable, if the
        // bean is still stored.
View Full Code Here

TOP

Related Classes of org.apache.axis2.addressing.EndpointReference

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.