Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisBinding


      if (axisService != null && axisOperation != null ) {
      if (axisService.getEndpointName() != null) {
        AxisEndpoint axisEndpoint = axisService
            .getEndpoint(axisService.getEndpointName());
        if (axisEndpoint != null) {
          AxisBinding axisBinding = axisEndpoint.getBinding();
                    AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding
              .getChild(axisOperation.getName());

                    //If Binding Operation is not found, just return null
                    if (axisBindingOperation == null) {
                       return null;
View Full Code Here


                // Add Service Bindings
                Map endPointMap = axisService.getEndpoints();
                for (Object o : endPointMap.entrySet()) {
                    Map.Entry entry = (Map.Entry) o;
                    AxisBinding axisBinding = ((AxisEndpoint) entry.getValue()).getBinding();
                    handleNewBindingAddition(serviceResourcePath, axisBinding);
                }

                // Add the Service Policies
                List<Resource> servicePolicies = getServicePolicies(axisService);
View Full Code Here

            // Fetch and attach Binding, Binding operation and their Message policies
            Map endPointMap = axisService.getEndpoints();
            for (Object o : endPointMap.entrySet()) {
                Map.Entry entry = (Map.Entry) o;
                AxisEndpoint point = (AxisEndpoint) entry.getValue();
                AxisBinding currentAxisBinding = point.getBinding();

                // Fetch binding policies
                String bindingPath = serviceResourcePath + RegistryResources.ServiceProperties
                        .BINDINGS + currentAxisBinding.getName().getLocalPart();
                if (configRegistry.resourceExists(bindingPath)) {
                    if (isProxyService) {
                        // This is to ensure that binding level policies applied from the UI
                        // get precedence over service level policies for proxy services
                        java.util.Collection<PolicyComponent> attachedPolicies = axisService.getPolicySubject().
                                getAttachedPolicyComponents();
                        if (attachedPolicies != null && !attachedPolicies.isEmpty()) {
                            List properties = getPropertyValues(bindingPath,
                                    RegistryResources.ServiceProperties.POLICY_UUID);
                            if (properties != null && properties.size() > 0) {
                                List<String> removablePolicies = new ArrayList<String>();
                                for (PolicyComponent pc : attachedPolicies) {
                                    if (pc instanceof Policy) {
                                        String id = ((Policy) pc).getId();
                                        if (properties.contains(id)) {
                                            removablePolicies.add(id);
                                        }
                                    }
                                }

                                for (String id : removablePolicies) {
                                    axisService.getPolicySubject().detachPolicyComponent(id);
                                }
                            }
                        }
                    }
                    loadPolicies(currentAxisBinding, getPropertyValues(bindingPath,
                            RegistryResources.ServiceProperties.POLICY_UUID),
                            serviceResourcePath);
                    Iterator operationsItr = currentAxisBinding.getChildren();
                    while (operationsItr.hasNext()) {
                        AxisBindingOperation bindingOp = (AxisBindingOperation) operationsItr.next();

                        // Fetch and attach binding operation policies
                        String bindingOpPath = PersistenceUtils
View Full Code Here

         * again. To remove that overhead, we memorize the treated bindings.
         */
        ArrayList<String> bindingsList = new ArrayList<String>();
        for (Object o : endPointMap.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            AxisBinding currentAxisBinding = ((AxisEndpoint) entry.getValue()).getBinding();

            if (bindingsList.contains(currentAxisBinding.getName().getLocalPart())) {
                continue;
            }
            // If we process this binding, add it's name to our list
            bindingsList.add(currentAxisBinding.getName().getLocalPart());

            // Get current binding Policy
            List<PolicyComponent> bindingPolicyList = new ArrayList<PolicyComponent>(
                    currentAxisBinding.getPolicySubject().getAttachedPolicyComponents());
            Policy bindingPolicy = PolicyUtil
                    .getMergedPolicy(bindingPolicyList, currentAxisBinding);

            if (bindingPolicy != null) {
                // Add this policy as a resource to the list
                addPolicyResource(policyResources, bindingPolicy, PolicyInclude.BINDING_POLICY);
                // Refer this policy from the binding resource
                setResourcePolicyId(serviceResourcePath + RegistryResources
                        .ServiceProperties.BINDINGS + currentAxisBinding.getName().getLocalPart(),
                        bindingPolicy.getId());
            }

            // Get Binding Operation Policies
            Iterator operations = currentAxisBinding.getChildren();
            while (operations.hasNext()) {
                AxisBindingOperation currentOperation = (AxisBindingOperation) operations.next();
                String opPath = PersistenceUtils
                        .getBindingOperationPath(serviceResourcePath, currentOperation);
                if (!configRegistry.resourceExists(opPath)) {
View Full Code Here

                                        getOperationFromHTTPLocation(httpLocation,
                                                                     httpLocationTable);
                                if (axisOperation != null) {
                                    messageContext.setProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME,
                                                               endpoint);
                                    AxisBinding axisBinding = endpoint.getBinding();
                                    if (axisBinding != null) {
                                        AxisBindingOperation axisBindingOperation =
                                                (AxisBindingOperation) axisBinding
                                                        .getChild(axisOperation.getName());
                                        messageContext.setProperty(Constants.AXIS_BINDING_OPERATION,
                                                                   axisBindingOperation);
                                        return axisOperation;
                                    }
View Full Code Here

    String serviceName = axisService.getName();
    String name = serviceName + "Soap11Binding";

    QName bindingName = new QName(name);

    AxisBinding axisBinding = (bindingCache != null) ? (AxisBinding) bindingCache
        .get(name)
        : null;
    if (axisBinding == null) {
      axisBinding = new AxisBinding();
      axisBinding.setName(bindingName);

      axisBinding.setType(Java2WSDLConstants.TRANSPORT_URI);
      axisBinding.setProperty(WSDLConstants.WSDL_1_1_STYLE,
          WSDLConstants.STYLE_DOC);

      axisBinding.setProperty(WSDL2Constants.ATTR_WSOAP_VERSION,
          SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

      for (Iterator iterator = axisService.getChildren(); iterator
          .hasNext();) {
        AxisOperation operation = (AxisOperation) iterator.next();
        AxisBindingOperation axisBindingOperation = new AxisBindingOperation();

        axisBindingOperation.setName(operation.getName());
        axisBindingOperation.setAxisOperation(operation);

        String soapAction = operation.getSoapAction();
        if (soapAction != null) {
          axisBindingOperation.setProperty(
              WSDL2Constants.ATTR_WSOAP_ACTION, soapAction);
        }
        axisBinding.addChild(axisBindingOperation.getName(),
            axisBindingOperation);
        populateBindingOperation(axisService, axisBinding,
            axisBindingOperation);
      }
      if (bindingCache != null) {
View Full Code Here

    String serviceName = axisService.getName();
    String name = serviceName + "Soap12Binding";

    QName bindingName = new QName(name);

    AxisBinding axisBinding = (bindingCache != null) ? (AxisBinding) bindingCache
        .get(name)
        : null;
    if (axisBinding == null) {
      axisBinding = new AxisBinding();
      axisBinding.setName(bindingName);

      axisBinding.setType(Java2WSDLConstants.TRANSPORT_URI);
      axisBinding.setProperty(WSDLConstants.WSDL_1_1_STYLE,
          WSDLConstants.STYLE_DOC);

      axisBinding.setProperty(WSDL2Constants.ATTR_WSOAP_VERSION,
          SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

      for (Iterator iterator = axisService.getChildren(); iterator
          .hasNext();) {
        AxisOperation operation = (AxisOperation) iterator.next();
        AxisBindingOperation axisBindingOperation = new AxisBindingOperation();

        axisBindingOperation.setName(operation.getName());
        axisBindingOperation.setAxisOperation(operation);

        String soapAction = operation.getSoapAction();
        if (soapAction != null) {
          axisBindingOperation.setProperty(
              WSDL2Constants.ATTR_WSOAP_ACTION, soapAction);
        }
        axisBinding.addChild(axisBindingOperation.getName(),
            axisBindingOperation);

        populateBindingOperation(axisService, axisBinding,
            axisBindingOperation);
      }
View Full Code Here

    String serviceName = axisService.getName();
    String name = serviceName + "HttpBinding";

    QName bindingName = new QName(name);

    AxisBinding axisBinding = (bindingCache != null) ? (AxisBinding) bindingCache
        .get(name)
        : null;

    if (axisBinding == null) {
      axisBinding = new AxisBinding();
      axisBinding.setName(bindingName);

      axisBinding.setType(WSDL2Constants.URI_WSDL2_HTTP);
      axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD, "POST");

      for (Iterator iterator = axisService.getChildren(); iterator
          .hasNext();) {
        AxisOperation operation = (AxisOperation) iterator.next();
        AxisBindingOperation axisBindingOperation = new AxisBindingOperation();

                QName operationQName = operation.getName();
                axisBindingOperation.setName(operationQName);
        axisBindingOperation.setAxisOperation(operation);
                String httpLocation = serviceName + "/" + operationQName.getLocalPart();
                axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, httpLocation);
        axisBinding.addChild(axisBindingOperation.getName(),
            axisBindingOperation);

        populateBindingOperation(axisService, axisBinding,
            axisBindingOperation);
      }
View Full Code Here

    String soapVersion = (identifier.indexOf("soap12") > -1) ? SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
        : SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;

    for (Iterator iterator = map.values().iterator(); iterator.hasNext();) {
      AxisEndpoint axisEndpoint = (AxisEndpoint) iterator.next();
      AxisBinding axisBinding = axisEndpoint.getBinding();
      String wsoap = (String) axisBinding
          .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
      if (soapVersion.equals(wsoap)) {
        String[] identifiers = identifier.split("/");
        int key = identifiers.length;
        if (key == 1) {
          axisBinding.getPolicySubject().attachPolicyComponents(
              policyComponents);
        } else if (key == 2 || key == 3) {
          String opName = identifiers[1];
          opName = opName.substring(opName.indexOf(":") + 1, opName
              .length());
          AxisBindingOperation bindingOperation = null;
          boolean found = false;
          for (Iterator i = axisBinding.getChildren(); i.hasNext();) {
            bindingOperation = (AxisBindingOperation) i.next();
            if (opName.equals(bindingOperation.getName()
                .getLocalPart())) {
              found = true;
              break;
View Full Code Here

            public int compare(Object o1, Object o2) {
                return (-1 * ((Comparable) o1).compareTo(o2));
            }
        });
        // StockServiceHttpBinding for StockService
        AxisBinding binding = new AxisBinding();
        binding.setName(new QName("StockServiceHttpBinding"));
        binding.setType("http://www.w3.org/ns/wsdl/http");
        binding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD_DEFAULT,
                            Constants.Configuration.HTTP_METHOD_GET);

        // AxisBindingOperation for addStock
        AxisBindingOperation bindingOperation1 = new AxisBindingOperation();
        bindingOperation1.setAxisOperation(axisService.getOperation(new QName("addStock")));
        bindingOperation1.setName(axisService.getOperation(new QName("addStock")).getName());
        bindingOperation1.setParent(binding);
        bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,
                                      Constants.Configuration.HTTP_METHOD_GET);
        bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION,
                                      "add/{name}/value/{value}");
        httpLocationTable.put(Constants.Configuration.HTTP_METHOD_GET + "/add/",
                              axisService.getOperation(new QName("addStock")));
        bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
                                      Constants.MIME_CT_APPLICATION_URL_ENCODED);
        bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,
                                      Constants.MIME_CT_APPLICATION_XML);
        binding.addChild(bindingOperation1);

        assertNotNull(binding.getChild(bindingOperation1.getName()));

        // AxisBindingOperation for getStockValue
        AxisBindingOperation bindingOperation2 = new AxisBindingOperation();
        bindingOperation2.setAxisOperation(axisService.getOperation(new QName("getStockValue")));
        bindingOperation2.setName(axisService.getOperation(new QName("getStockValue")).getName());
        bindingOperation2.setParent(binding);
        bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,
                                      Constants.Configuration.HTTP_METHOD_GET);
        bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "get/{name}");
        httpLocationTable.put(Constants.Configuration.HTTP_METHOD_GET + "/get/",
                              axisService.getOperation(new QName("getStockValue")));
        bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
                                      Constants.MIME_CT_APPLICATION_URL_ENCODED);
        bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,
                                      Constants.MIME_CT_APPLICATION_XML);
        binding.addChild(bindingOperation2);

        assertNotNull(binding.getChild(bindingOperation2.getName()));
        binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, httpLocationTable);

        // adding Http AxisEndpoint, HttpBinding to service
        AxisEndpoint axisEndpoint = new AxisEndpoint();
        axisEndpoint.setBinding(binding);
        axisEndpoint.setName("StockServiceHttpEndpoint");
View Full Code Here

TOP

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

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.