Package org.apache.axis2.context

Examples of org.apache.axis2.context.ServiceContext


                options.setAction("urn:echo");
                options.setTo(new EndpointReference("http://127.0.0.1:" +
                                        PORT + 
                                        "/axis2/services/SecureService" + i));
               
                ServiceContext context = serviceClient.getServiceContext();
                context.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
                        loadPolicy("/rampart/policy/" + i + ".xml"));
                serviceClient.setOptions(options);
               
                //Blocking invocation
                serviceClient.sendReceive(getEchoElement());
View Full Code Here


        AxisServiceGroup axisServiceGroup = new AxisServiceGroup();
        axisConfiguration.addServiceGroup(axisServiceGroup);
        ctx.setConfigurationContext(new ConfigurationContext(axisConfiguration));
        axisServiceGroup.addService(axisService);
        ServiceGroupContext gCtx = ctx.getConfigurationContext().createServiceGroupContext(axisServiceGroup);
        ServiceContext serviceContext = gCtx.getServiceContext(axisService);
        ctx.setServiceContext(serviceContext);
        ctx.setAxisService(axisService);
        OutInAxisOperation outInAxisOperation = new OutInAxisOperation(new QName("http://rampart.org", "test"));
        AxisMessage msg = new AxisMessage();
        outInAxisOperation.addMessage(msg,WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
View Full Code Here

          // 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);
            responseMsgOpCtx = OperationContextFactory.createOperationContext (op.getAxisSpecificMEPConstant(), op, serviceCtx);         

          }
         
View Full Code Here

   * @return
   * @throws SandeshaException
   */
  public static SequenceReport getOutgoingSequenceReport(ServiceClient serviceClient) throws SandeshaException {

    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    ConfigurationContext configurationContext = serviceContext.getConfigurationContext();

    String internalSequenceID = getInternalSequenceIdFromServiceClient(serviceClient);

    return getOutgoingSequenceReport(internalSequenceID, configurationContext);
  }
View Full Code Here

    options.setProperty(SandeshaClientConstants.DUMMY_MESSAGE, Sandesha2Constants.VALUE_TRUE);

    String oldAction = options.getAction();
    options.setAction(SpecSpecificConstants.getCreateSequenceAction(rmSpecVersion));
   
    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    ConfigurationContext configurationContext = serviceContext.getConfigurationContext();

    // cleanup previous sequence
    cleanupTerminatedSequence(to, oldSequenceKey, SandeshaUtil.getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration()));
   
    try {     
View Full Code Here

   */
  public static void terminateSequence(ServiceClient serviceClient) throws SandeshaException {
   
    setUpServiceClientAnonymousOperations (serviceClient);
   
    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    Options options = serviceClient.getOptions();
    if (options == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.optionsObjectNotSet));

    String rmSpecVersion = (String) options.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);

    if (rmSpecVersion == null)
      rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    String oldAction = options.getAction();

    //in WSRM 1.0 we are adding another application msg with the LastMessage tag, instead of sending a terminate here.
    //Actual terminate will be sent once all the messages upto this get acked
   
    try {
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(rmSpecVersion)) {
        SOAPEnvelope terminateEnvelope = configureTerminateSequence(options, serviceContext
            .getConfigurationContext());
        OMElement terminateBody = terminateEnvelope.getBody().getFirstChildWithName(
            new QName(rmNamespaceValue,
                Sandesha2Constants.WSRM_COMMON.TERMINATE_SEQUENCE));

View Full Code Here

   */
  public static void closeSequence(ServiceClient serviceClient) throws SandeshaException {
   
    setUpServiceClientAnonymousOperations (serviceClient);
   
    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    Options options = serviceClient.getOptions();
    if (options == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.optionsObjectNotSet));

    String rmSpecVersion = (String) options.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);

    if (rmSpecVersion == null)
      rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    SOAPEnvelope closeSequnceEnvelope = configureCloseSequence(options, serviceContext.getConfigurationContext());
    OMElement closeSequenceBody = closeSequnceEnvelope.getBody().getFirstChildWithName(
        new QName(rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.CLOSE_SEQUENCE));

    String oldAction = options.getAction();
    options.setAction(SpecSpecificConstants.getCloseSequenceAction(rmSpecVersion));
View Full Code Here

  // SandeshaException
  public static String getSequenceID(ServiceClient serviceClient) throws SandeshaException {

    String internalSequenceID = getInternalSequenceIdFromServiceClient(serviceClient);

    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    ConfigurationContext configurationContext = serviceContext.getConfigurationContext();

    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    if (sequenceReport == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.cannotFindReportForGivenData, serviceClient.toString()));
View Full Code Here

    Options options = serviceClient.getOptions();
    if (options == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.optionsObjectNotSet));

    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    ConfigurationContext configContext = serviceContext.getConfigurationContext();

    String rmSpecVersion = (String) options.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);
    if (rmSpecVersion == null)
      rmSpecVersion = Sandesha2Constants.SPEC_VERSIONS.v1_0;
View Full Code Here

    String internalSequenceId = getInternalSequenceIdFromServiceClient(serviceClient);
   
    if (log.isTraceEnabled())
      log.trace("Looking up sequence with identifier " + internalSequenceId);
   
    ServiceContext serviceContext = serviceClient.getServiceContext();
    if (serviceContext == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.serviceContextNotSet));

    ConfigurationContext configurationContext = serviceContext.getConfigurationContext();

    // Get the in use storage manager and the sequence property bean manager
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
   
    Transaction transaction = null;
View Full Code Here

TOP

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

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.