Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisService


   * will try to add them into the serviceClient.
   */
  private static void setUpServiceClientAnonymousOperations (ServiceClient serviceClient) throws SandeshaException {
    try {
     
      AxisService service = serviceClient.getAxisService();

      AxisOperation anonOutOnlyOperation = service.getOperation(ServiceClient.ANON_OUT_ONLY_OP);
     
      if (anonOutOnlyOperation==null) {
        anonOutOnlyOperation = AxisOperationFactory.getAxisOperation(WSDLConstants.MEP_CONSTANT_OUT_ONLY);
        anonOutOnlyOperation.setName(ServiceClient.ANON_OUT_ONLY_OP);
       
        AxisOperation referenceOperation = service.getOperation(Sandesha2Constants.RM_IN_ONLY_OPERATION);
       
        if (referenceOperation!=null) {
          anonOutOnlyOperation.setPhasesOutFlow(referenceOperation.getPhasesOutFlow());
          anonOutOnlyOperation.setPhasesOutFaultFlow(referenceOperation.getPhasesOutFaultFlow());
          anonOutOnlyOperation.setPhasesInFaultFlow(referenceOperation.getPhasesInFaultFlow());
          anonOutOnlyOperation.setPhasesInFaultFlow(referenceOperation.getRemainingPhasesInFlow());

          service.addOperation(anonOutOnlyOperation);
        } else {
          String message = "Cant find RM Operations. Please engage the Sandesha2 module before doing the invocation.";
          throw new SandeshaException (message);
        }
      }

      AxisOperation anonOutInOperation = service.getOperation(ServiceClient.ANON_OUT_IN_OP);
     
      if (anonOutInOperation==null) {
        anonOutInOperation = AxisOperationFactory.getAxisOperation(WSDLConstants.MEP_CONSTANT_OUT_IN);
        anonOutInOperation.setName(ServiceClient.ANON_OUT_IN_OP);
       
        AxisOperation referenceOperation = service.getOperation(Sandesha2Constants.RM_IN_OUT_OPERATION);
       
        if (referenceOperation!=null) {
          anonOutInOperation.setPhasesOutFlow(referenceOperation.getPhasesOutFlow());
          anonOutInOperation.setPhasesOutFaultFlow(referenceOperation.getPhasesOutFaultFlow());
          anonOutInOperation.setPhasesInFaultFlow(referenceOperation.getPhasesInFaultFlow());
          anonOutInOperation.setPhasesInFaultFlow(referenceOperation.getRemainingPhasesInFlow());
         
          //operation will be added to the service only if a valid referenceOperation was found.
          service.addOperation(anonOutInOperation);
        }
      }
    } catch (AxisFault e) {
      throw new SandeshaException (e);
    }
View Full Code Here


    return soapNamespaceURI;
  }
 
  public static void setPolicyBean (ServiceClient serviceClient, SandeshaPolicyBean policyBean) throws SandeshaException {
    try {
      AxisService axisService = serviceClient.getAxisService();
      if (axisService!=null) {
        Parameter parameter = axisService.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        SandeshaPolicyBean parent = null;
        if (parameter==null) {
          parameter = new Parameter ();
          parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        } else {
          parent = (SandeshaPolicyBean) parameter.getValue();
          policyBean.setParent(parent);
        }
       
        parameter.setValue(policyBean);
        axisService.addParameter(parameter);
      } else {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSetPolicyBeanServiceNull);
        throw new SandeshaException (message);
      }
    } catch (AxisFault e) {
View Full Code Here

    try {
      StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());
      transaction = storageManager.getTransaction();

      AxisService axisService = msgCtx.getAxisService();
      if (axisService == null) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.axisServiceIsNull);
        log.debug(message);
        throw new AxisFault(message);
      }
View Full Code Here

    RMMsgContext rmmsgContext = MsgInitializer.initializeMessage(msgContext);
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration());
   
    Transaction transaction = storageManager.getTransaction();
   
    AxisService service;
    try {
      String sequenceID = (String) rmmsgContext
          .getProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID);
      service = null;
      if (sequenceID != null) {
View Full Code Here

                }
              }
            }
           
            //checking weather the module is engaged at the Service level
            AxisService service = messageContext.getAxisService();
            if (service!=null) {
              Collection modules = service.getEngagedModules();
              for (Iterator iter = modules.iterator();iter.hasNext();) {
                AxisModule module = (AxisModule) iter.next();
                String name = module.getName();
                if (name!=null && name.startsWith (Sandesha2Constants.MODULE_NAME)) {
                  engaged = true;
View Full Code Here

    // any OUT_IN MEPs on it's operations. If there are then we record that,
    // so that we know we should send an Offer for WSRM 1.0 Sequences.
    // We check the operation names, as the RM operations are added in as
    // well, and and we only want to consider the user's operations.
    if(axisDescription instanceof AxisService) {
      AxisService service = (AxisService) axisDescription;
      Iterator ops = service.getOperations();
      while(ops.hasNext()) {
        AxisOperation op = (AxisOperation) ops.next();
        log.debug("Examining operation " + op.getName() + ", mep " + op.getMessageExchangePattern());

        String name = null;
        QName qName = op.getName();
        if(qName != null) name = qName.getLocalPart();
        if((name != null && name.startsWith(Sandesha2Constants.SANDESHA_OP_PREFIX)) ||
           ServiceClient.ANON_OUT_IN_OP.equals(qName))
          break;

        // If we get to here then we must have one of the user's operations, so
        // check the MEP.
        if(op.getAxisSpecifMEPConstant() == WSDLConstants.MEP_CONSTANT_OUT_IN) {
          Parameter p = new Parameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS, Boolean.TRUE);
          service.addParameter(p);
          break;
        }
      }
    } else if(axisDescription instanceof AxisOperation) {
      AxisOperation op = (AxisOperation) axisDescription;
View Full Code Here

   
    CreateSequence createSequencePart = new CreateSequence(rmNamespaceValue);

    // Check if this service includes 2-way operations
    boolean twoWayService = false;
    AxisService service = applicationMsgContext.getAxisService();
    if(service != null) {
      Parameter p = service.getParameter(Sandesha2Constants.SERVICE_CONTAINS_OUT_IN_MEPS);
      if(p != null && p.getValue() != null) {
        twoWayService = ((Boolean) p.getValue()).booleanValue();
      }
    }
   
View Full Code Here

    }
   
    public void overrideConfigurationContext (ConfigurationContext context,MessageReceiver messageReceiver, String operationName, boolean newOperation, int mep) throws Exception  {
     
     
      AxisService rmService = context.getAxisConfiguration().getService(RMServiceName);
     
      AxisOperation operation = null;
     
      if (newOperation) {
        operation = rmService.getOperation(new QName (operationName));
        if (operation==null)
          throw new Exception ("Given operation not found");
      } else {
        operation = AxisOperationFactory.getAxisOperation(mep);
        rmService.addOperation(operation);
      }
     
      operation.setMessageReceiver(messageReceiver);
    }
View Full Code Here

    private String getServiceImplClassName(MessageContext mc) {
        // The PARAM_SERVICE_CLASS property that is set on the AxisService
        // will tell us what the service implementation class is.
        org.apache.axis2.context.MessageContext axisMsgContext = mc.getAxisMessageContext();
        AxisService as = axisMsgContext.getAxisService();
        Parameter param = as.getParameter(org.apache.axis2.Constants.SERVICE_CLASS);

        // If there was no implementation class, we should not go any further
        if (param == null) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
                    "EndpointControllerErr2"));
View Full Code Here

    /*
    * Gets the EndpointDescription associated with the request that is currently
    * being processed.
    */
    private EndpointDescription getEndpointDescription(MessageContext mc) {
        AxisService axisSvc = mc.getAxisMessageContext().getAxisService();
        Parameter param = axisSvc.getParameter(EndpointDescription.AXIS_SERVICE_PARAMETER);
       
        if (param == null) {
          // If we've made it here, its very likely that although the AxisService was deployed, the
          // associated ServiceDescription was not created successfully
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescErr1"));
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.AxisService

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.