Package javax.wsdl.extensions

Examples of javax.wsdl.extensions.UnknownExtensibilityElement


        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

            wsdl4jExtensibilityElement = (ExtensibilityElement) iterator.next();

            if (wsdl4jExtensibilityElement instanceof UnknownExtensibilityElement) {

                UnknownExtensibilityElement unknown =
                        (UnknownExtensibilityElement) (wsdl4jExtensibilityElement);
                QName type = unknown.getElementType();
               
                // <wsp:Policy>
                if (Constants.isPolicyElement(type)) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: PolicyElement found " + unknown);
                    }
                    Policy policy = (Policy) PolicyUtil.getPolicyComponent(unknown.getElement());
                    description.getPolicySubject().attachPolicy(policy);
                   
//                    int attachmentScope =
//                            getPolicyAttachmentPoint(description, originOfExtensibilityElements);
//                    if (attachmentScope > -1) {
//                        description.getPolicyInclude().addPolicyElement(
//                                attachmentScope, policy);
//                    }
                    // <wsp:PolicyReference>
                } else if (Constants.isPolicyRef(type)) {
                    if (isTraceEnabled) {
                        log.trace("copyExtensibleElements:: PolicyReference found " + unknown);
                    }
                    PolicyReference policyReference = (PolicyReference) PolicyUtil
                            .getPolicyComponent(unknown.getElement());
                    description.getPolicySubject().attachPolicyReference(policyReference);
                   
//                    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())) {
                          AddressingHelper.setAddressingRequirementParemeterValue(axisService, AddressingConstants.ADDRESSING_REQUIRED);
                        } else {
                          AddressingHelper.setAddressingRequirementParemeterValue(axisService, AddressingConstants.ADDRESSING_OPTIONAL);
                        }
                    }

                }    else if (wsdl4jExtensibilityElement.getElementType() != null &&
                        wsdl4jExtensibilityElement.getElementType().getNamespaceURI().equals(
                                org.apache.axis2.namespace.Constants.FORMAT_BINDING)) {
                    Element typeMapping = unknown.getElement();
                   
                    NodeList typeMaps = typeMapping.getElementsByTagNameNS(
                            org.apache.axis2.namespace.Constants.FORMAT_BINDING,
                            "typeMap");
                    int count = typeMaps.getLength();
                    HashMap typeMapper = new HashMap();
                    for (int index = 0; index < count; index++) {
                        Node node = typeMaps.item(index);
                        NamedNodeMap attributes = node.getAttributes();
                        Node typeName = attributes.getNamedItem("typeName");

                        if (typeName != null) {
                            String prefix = getPrefix(typeName.getNodeValue());

                            if (prefix != null) {
                                String ns = (String) wsdl4jDefinition.getNamespaces().get(prefix);
                                if (ns != null) {
                                    Node formatType = attributes.getNamedItem("formatType");
                                    typeMapper.put(new QName(ns, getTypeName(
                                            typeName.getNodeValue())), formatType.getNodeValue());
                                }

                            }
                        }
                    }
                } else if (wsdl4jExtensibilityElement.getElementType() != null &&
                        wsdl4jExtensibilityElement.getElementType().getNamespaceURI().equals(
                                org.apache.axis2.namespace.Constants.JAVA_NS)) {
                    Element unknowJavaElement = unknown.getElement();
                    if (unknowJavaElement.getLocalName().equals("address") ) {
                        NamedNodeMap nameAttributes = unknowJavaElement.getAttributes();
                        Node node = nameAttributes.getNamedItem("className");
                        Parameter serviceClass = new Parameter();
                        serviceClass.setName("className");
View Full Code Here

   */
    private void processPoliciesInDefintion(Definition definition, Set visitedWSDLs) {
        visitedWSDLs.add(definition.getDocumentBaseURI());
        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 (Constants.isPolicyElement(unknown.getElementType())) {

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

            pw.println( "        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);" );
         }
         else if ( obj instanceof UnknownExtensibilityElement )
         {
            // TODO: After WSDL4J supports soap12, change this code
            UnknownExtensibilityElement unkElement = (UnknownExtensibilityElement) obj;
            QName                       name = unkElement.getElementType(  );

            if ( name.getNamespaceURI(  ).equals( Constants.URI_WSDL12_SOAP )
                 && name.getLocalPart(  ).equals( "binding" ) )
            {
               pw.println( "        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS);" );
View Full Code Here

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

                    Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
                    if (service.getDescription() == null && cls != null) {
                        service.setDescription(new DescriptionInfo());
                        service.getDescription().setBaseURI(cls.getResource("/").toString());
                    }
                    UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                    uee.setElement(doc.getDocumentElement());
                    uee.setRequired(true);
                    uee.setElementType(DOMUtils.getElementQName(doc.getDocumentElement()));
                    service.getDescription().addExtensor(uee);
                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
                    if (StringUtils.isEmpty(uri)) {
                        uri = defName;
View Full Code Here

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

                    Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
                    if (service.getDescription() == null && cls != null) {
                        service.setDescription(new DescriptionInfo());
                        service.getDescription().setBaseURI(cls.getResource("/").toString());
                    }
                    UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
                    uee.setElement(doc.getDocumentElement());
                    uee.setRequired(true);
                    uee.setElementType(DOMUtils.getElementQName(doc.getDocumentElement()));
                    service.getDescription().addExtensor(uee);
                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
                    if (StringUtils.isEmpty(uri)) {
                        uri = defName;
View Full Code Here

    protected void addExtensibilityElements(ElementExtensible elementExtensible,
        List<ExtensibilityElement> extensibilityElements) {
        if (extensibilityElements != null) {
            for (ExtensibilityElement element : extensibilityElements) {
                if (element instanceof UnknownExtensibilityElement) {
                    UnknownExtensibilityElement uee = (UnknownExtensibilityElement)element;
                    String pfx = uee.getElement().getPrefix();
                    addNamespace(pfx, element.getElementType().getNamespaceURI());
                } else {
                    QName qn = element.getElementType();
                    addNamespace(qn.getNamespaceURI());
                }
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.