Package javax.wsdl.extensions

Examples of javax.wsdl.extensions.UnknownExtensibilityElement


            wsdl4jExtensibilityElement = (ExtensibilityElement) iterator.next();

            if (wsdl4jExtensibilityElement instanceof UnknownExtensibilityElement) {

                UnknownExtensibilityElement unknown =
                        (UnknownExtensibilityElement) (wsdl4jExtensibilityElement);
                QName type = unknown.getElementType();

                // <wsp:Policy>
                if (WSDLConstants.WSDL11Constants.POLICY.equals(type)) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: PolicyElement found " + unknown);
                    }
                    Policy policy = (Policy) PolicyUtil.getPolicyComponent(unknown.getElement());
                    int attachmentScope =
                            getPolicyAttachmentPoint(description, originOfExtensibilityElements);
                    if (attachmentScope > -1) {
                        description.getPolicyInclude().addPolicyElement(
                                attachmentScope, policy);
                    }
                    // <wsp:PolicyReference>
                } else if (WSDLConstants.WSDL11Constants.POLICY_REFERENCE
                        .equals(type)) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: PolicyReference found " + unknown);
                    }
                    PolicyReference policyReference = (PolicyReference) PolicyUtil
                            .getPolicyComponent(unknown.getElement());
                    int attachmentScope =
                            getPolicyAttachmentPoint(description, originOfExtensibilityElements);
                    if (attachmentScope > -1) {
                        description.getPolicyInclude().addPolicyRefElement(
                                attachmentScope, policyReference);
                    }
                } else if (AddressingConstants.Final.WSAW_USING_ADDRESSING
                        .equals(type)
                           || AddressingConstants.Submission.WSAW_USING_ADDRESSING
                        .equals(unknown.getElementType())) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: wsaw:UsingAddressing found " + unknown);
                    }
                    // FIXME We need to set this the appropriate Axis Description AxisEndpoint or
                    // AxisBinding .
                    if (originOfExtensibilityElements.equals(PORT)
                        || originOfExtensibilityElements.equals(BINDING)) {
                        if (Boolean.TRUE.equals(unknown.getRequired())) {
                            axisService
                                    .setWSAddressingFlag(AddressingConstants.ADDRESSING_REQUIRED);
                        } else {
                            axisService
                                    .setWSAddressingFlag(AddressingConstants.ADDRESSING_OPTIONAL);
                        }
                    }

                } else if (AddressingConstants.Final.WSAW_ANONYMOUS
                        .equals(unknown.getElementType())) {
                    if (originOfExtensibilityElements.equals(BINDING_OPERATION)) {
                        AxisOperation axisOperation = (AxisOperation) description;
                        if (unknown.getElement().getFirstChild() != null
                            && unknown.getElement().getFirstChild()
                                .getNodeType() == Node.TEXT_NODE) {
                            String anonymousValue = unknown.getElement()
                                    .getFirstChild().getNodeValue();
                            AddressingHelper.setAnonymousParameterValue(
                                    axisOperation, anonymousValue);
                        }
                    }
View Full Code Here


     */
    private void processPoliciesInDefintion(Definition definition, Stack stack) {
        stack.push(definition);
        List extElements = definition.getExtensibilityElements();
        ExtensibilityElement extElement;
        UnknownExtensibilityElement unknown = null;
        Policy policy = null;

        for (Iterator iterator = extElements.iterator(); iterator.hasNext();) {
            extElement = (ExtensibilityElement) iterator.next();

            if (extElement instanceof UnknownExtensibilityElement) {
                unknown = (UnknownExtensibilityElement) extElement;
                if (WSDLConstants.WSDL11Constants.POLICY.equals(unknown.getElementType())) {

                    policy = (Policy) PolicyUtil.getPolicyComponent(unknown.getElement());
                    String key;
                    if ((key = policy.getName()) != null || (key = policy.getId()) != null) {
                        registry.register(key, policy);
                        registry.register("#" + key, policy);
                    }
View Full Code Here

                           Policy p,
                           Class<?> cls,
                           String defName) {
        Element el = addPolicy(service, p, cls, defName);
        if (el != null) {
            UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
            uee.setElement(el);
            uee.setRequired(true);
            uee.setElementType(DOMUtils.getElementQName(el));
            place.addExtensor(uee);
        }
    }
View Full Code Here

            }

            // if not already added to service add it, otherwise ignore
            // and just create the policy reference.
            if (!isExistsPolicy(service, uri)) {
                UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                uee.setElement(element);
                uee.setRequired(true);
                uee.setElementType(DOMUtils.getElementQName(element));
                service.getDescription().addExtensor(uee);
            }
           
            uri = "#" + uri;
        }
View Full Code Here

    private boolean isExistsPolicy(ServiceInfo service, String uri) {
        Object exts[] = service.getDescription().getExtensors().get();
        exts = exts == null ? new Object[0] : exts;
        for (Object o : exts) {
            if (o instanceof UnknownExtensibilityElement) {
                UnknownExtensibilityElement uee = (UnknownExtensibilityElement)o;
                String uri2 = getPolicyId(uee.getElement());
                if (uri.equals(uri2)) {
                    return true;
                }
            }
        }
View Full Code Here

            DOMImplementation dImpl = builder.getDOMImplementation();

            String policyID = portName + "_Policy";
            String inputPolicyID = portName + "_operationPolicy";

            UnknownExtensibilityElement serviceLevelPolicRef = null;
            UnknownExtensibilityElement opLevelPolicRef = null;

            String namespace = GFacSchemaConstants.GFAC_NAMESPACE;
            Document doc = dImpl.createDocument(namespace, "factoryServices", null);

            String description = serviceDesc.getService().getServiceDescription();
            if (description != null) {
                Element documentation = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "wsdl:documentation");
                documentation.appendChild(doc.createTextNode(description));
                def.setDocumentationElement(documentation);
            }

            if (GFacSchemaConstants.TRANSPORT_LEVEL.equals(security)) {
                def.addExtensibilityElement(createTransportLevelPolicy(dImpl, policyID));
                serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
            } else if (GFacSchemaConstants.MESSAGE_SIGNATURE.equals(security)) {
                def.addExtensibilityElement(WSPolicyGenerator.createServiceLevelPolicy(dImpl, policyID));
                serviceLevelPolicRef = createWSPolicyRef(dImpl, policyID);
                opLevelPolicRef = createWSPolicyRef(dImpl, inputPolicyID);
            }

            // Create types
            Types types = TypesGenerator.addTypes(def, dImpl, serviceDesc, typens, globalTypens);
            def.setTypes(types);

            // if(!abstractWSDL)
            // {
            // table = createMessageTable(serviceDesc, typens, operation);
            // }

            // Create port types (only first port type)
            PortTypeImpl wsdlPortType = addPortTypes(def, dImpl, portType, serviceQName);
            Binding binding = addBinding(def, nameSpaceURI, wsdlPortType, serviceLevelPolicRef, dImpl);

            String methodDesc = serviceDesc.getPortType().getMethod().getMethodDescription();
            String methodName = serviceDesc.getPortType().getMethod().getMethodName();
            OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();

            OperationImpl operation = addOperation(def, dImpl, methodName, methodDesc, typens, outputParams);
            wsdlPortType.addOperation(operation);

            if (!abstractWSDL) {
                UnknownExtensibilityElement wsInPolicyRef = null;
                UnknownExtensibilityElement wsOutPolicyRef = null;

                BindingInputImpl bindingInput = addBindingInput(def, methodName, wsInPolicyRef);
                BindingOutputImpl bindingOutput = addBindingOutput(def, methodName, outputParams, wsOutPolicyRef);
                BindingOperation bindingOperation = addBindingOperation(def, operation, dImpl);
                bindingOperation.setBindingInput(bindingInput);
View Full Code Here

    private UnknownExtensibilityElement createWSPolicyRef(DOMImplementation dImpl, String id) {
        Document doc = dImpl.createDocument(WSP_NAMESPACE, "wsp:PolicyReference", null);
        Element policyRef = doc.getDocumentElement();
        policyRef.setAttribute("URI", "#" + id);
        UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
        elem.setElement(policyRef);
        elem.setElementType(new QName(WSP_NAMESPACE, "PolicyReference"));
        return elem;
    }
View Full Code Here

         */

        exactlyOne.appendChild(all);
        policy.appendChild(exactlyOne);

        UnknownExtensibilityElement elem = new UnknownExtensibilityElement();
        elem.setElement(policy);
        elem.setElementType(new QName(WSP_NAMESPACE, "wsp:Policy"));
        return elem;
    }
View Full Code Here

        bindingOperation.addExtensibilityElement(soapOperation);
        bindingOperation.setOperation(operation);

        Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);

        UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
        Element anonymousEle = doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:Anonymous");
        anonymousEle.appendChild(doc.createTextNode("optional"));
        exEle.setElement(anonymousEle);
        exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:Anonymous"));
        bindingOperation.addExtensibilityElement(exEle);
        return bindingOperation;
    }
View Full Code Here

            binding.addExtensibilityElement(wsPolicyRef);
        }

        Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);

        UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
        exEle.setElement(doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
        exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
        binding.addExtensibilityElement(exEle);

        return binding;
    }
View Full Code Here

TOP

Related Classes of javax.wsdl.extensions.UnknownExtensibilityElement

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.