Package org.apache.synapse.endpoints

Examples of org.apache.synapse.endpoints.EndpointDefinition


        DefaultEndpoint defaultEndpoint = (DefaultEndpoint) endpoint;

        serializeCommonAttributes(defaultEndpoint,endpointElement);
       
        EndpointDefinition epAddress = defaultEndpoint.getDefinition();
        OMElement defaultElement = serializeEndpointDefinition(epAddress);
        endpointElement.addChild(defaultElement);

        // serialize the properties
        serializeProperties(defaultEndpoint, endpointElement);
View Full Code Here


        // serialize the properties
        serializeProperties(addressEndpoint, endpointElement);
        //serialize attributes
        serializeCommonAttributes(endpoint,endpointElement);

        EndpointDefinition epAddress = addressEndpoint.getDefinition();
        OMElement addressElement = serializeEndpointDefinition(epAddress);
        endpointElement.addChild(addressElement);

        return endpointElement;
    }
View Full Code Here

        }

        // currently, we have to get QOS information from the endpoint definition and set them as
        // special elements under the wsdl element. in future, these information should be
        // extracted from the wsdl.
        EndpointDefinition epDefinition = wsdlEndpoint.getDefinition();
        serializeCommonEndpointProperties(epDefinition, wsdlElement);
        serializeSpecificEndpointProperties(epDefinition, wsdlElement);
        endpointElement.addChild(wsdlElement);

        return endpointElement;
View Full Code Here

                }
            }
        }

        if (serviceURL != null) {
            EndpointDefinition endpointDefinition = new EndpointDefinition();
            endpointDefinition.setAddress(serviceURL);
            if (SynapseConstants.FORMAT_SOAP11.equals(format)) {
                endpointDefinition.setForceSOAP11(true);
            } else if (SynapseConstants.FORMAT_SOAP12.equals(format)) {
                endpointDefinition.setForceSOAP12(true);
            } else if (SynapseConstants.FORMAT_REST.equals(format)){
                endpointDefinition.setForceREST(true);
            } else if (SynapseConstants.FORMAT_GET.equals(format)){
                endpointDefinition.setForceGET(true);
            } else {
                handleException("format value '" + format + "' not yet implemented");
            }
            endpointDefinition.setFormat(format);

            // todo: determine this using wsdl and policy                                   

            return endpointDefinition;
View Full Code Here

        }

        OMElement addressElement = epConfig.getFirstChildWithName(
                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "address"));
        if (addressElement != null) {
            EndpointDefinition definition = createEndpointDefinition(addressElement);
            addressEndpoint.setDefinition(definition);
            processAuditStatus(definition, addressEndpoint.getName(), addressElement);
        }

        processProperties(addressEndpoint, epConfig);
View Full Code Here

    @Override
    public EndpointDefinition createEndpointDefinition(OMElement elem) {

        OMAttribute address = elem.getAttribute(new QName("uri"));
        DefinitionFactory fac = getEndpointDefinitionFactory();
        EndpointDefinition endpointDefinition;
        if (fac == null) {
            fac = new EndpointDefinitionFactory();
            endpointDefinition = fac.createDefinition(elem);
        } else{
            endpointDefinition = fac.createDefinition(elem);
        }

        if (address != null) {
            endpointDefinition.setAddress(address.getAttributeValue().trim());
        }

        extractSpecificEndpointProperties(endpointDefinition, elem);
        return endpointDefinition;
    }
View Full Code Here

     * @param se    synapse environment
     * @return AddressEndpoint address endpoint
     */
    private Endpoint getEndpointFromURL(String endpointUrl, SynapseEnvironment se) {
        AddressEndpoint endpoint = new AddressEndpoint();
        EndpointDefinition def = new EndpointDefinition();
        def.setAddress(endpointUrl.trim());
        endpoint.setDefinition(def);

        endpoint.init(se);

        return endpoint;
View Full Code Here

        OMElement wsdlElement = epConfig.getFirstChildWithName
                (new QName(SynapseConstants.SYNAPSE_NAMESPACE, "wsdl"));
        if (wsdlElement != null) {

            DefinitionFactory fac = getEndpointDefinitionFactory();
            EndpointDefinition endpoint;
            if (fac == null) {
                fac = new EndpointDefinitionFactory();
                endpoint = fac.createDefinition(wsdlElement);
            } else {
                endpoint = fac.createDefinition(wsdlElement);
            }

            // for now, QOS information has to be provided explicitly.
            extractSpecificEndpointProperties(endpoint, wsdlElement);
            wsdlEndpoint.setDefinition(endpoint);
            processAuditStatus(endpoint, wsdlEndpoint.getName(), wsdlElement);

            // get the service name and port name. at this point we should not worry about
            // the presence of those parameters. they are handled by corresponding WSDL builders.
            String serviceName = wsdlElement.getAttributeValue(new QName("service"));
            String portName = wsdlElement.getAttributeValue(new QName("port"));
            // check if wsdl is supplied as a URI
            String wsdlURI = wsdlElement.getAttributeValue(new QName("uri"));

            // set serviceName and portName in the endpoint. it does not matter if these are
            // null at this point. we are setting them only for serialization purpose.
            wsdlEndpoint.setServiceName(serviceName);
            wsdlEndpoint.setPortName(portName);

            String noParsing = properties.getProperty(SKIP_WSDL_PARSING);

            if (wsdlURI != null) {
                wsdlEndpoint.setWsdlURI(wsdlURI.trim());
                if (noParsing == null || !JavaUtils.isTrueExplicitly(noParsing)) {
                    try {
                        OMNode wsdlOM = SynapseConfigUtils.getOMElementFromURL(new URL(wsdlURI)
                                .toString(), properties.get(SynapseConstants.SYNAPSE_HOME) != null ?
                                properties.get(SynapseConstants.SYNAPSE_HOME).toString() : "");
                        if (wsdlOM != null && wsdlOM instanceof OMElement) {
                            OMElement omElement = (OMElement) wsdlOM;
                            OMNamespace ns = omElement.getNamespace();
                            if (ns != null) {
                                String nsUri = omElement.getNamespace().getNamespaceURI();
                                if (org.apache.axis2.namespace.Constants.NS_URI_WSDL11.equals(nsUri)) {

                                    new WSDL11EndpointBuilder().
                                            populateEndpointDefinitionFromWSDL(endpoint,
                                                    wsdlURI.trim(), omElement, serviceName, portName);

                                } else if (WSDL2Constants.WSDL_NAMESPACE.equals(nsUri)) {
                                    //endpoint = new WSDL20EndpointBuilder().
                                    // createEndpointDefinitionFromWSDL(wsdlURI, serviceName, portName);

                                    handleException("WSDL 2.0 Endpoints are currently not supported");
                                }
                            }
                        }
                    } catch (Exception e) {
                        handleException("Couldn't create endpoint from the given WSDL URI : "
                                + e.getMessage(), e);
                    }
                }
            }

            // check if the wsdl 1.1 document is supplied inline
            OMElement definitionElement = wsdlElement.getFirstChildWithName
                    (new QName(org.apache.axis2.namespace.Constants.NS_URI_WSDL11, "definitions"));
            if (endpoint == null && definitionElement != null) {
                wsdlEndpoint.setWsdlDoc(definitionElement);

                if (noParsing == null || !JavaUtils.isTrueExplicitly(noParsing)) {
                    String resolveRoot = properties.get(SynapseConstants.RESOLVE_ROOT).toString();
                    String baseUri = "file:./";
                    if (resolveRoot != null) {
                        baseUri = resolveRoot.trim();
                    }
                    if (!baseUri.endsWith(File.separator)) {
                        baseUri = baseUri + File.separator;
                    }
                    new WSDL11EndpointBuilder().populateEndpointDefinitionFromWSDL(endpoint,
                            baseUri, definitionElement, serviceName, portName);
                } else {
                    endpoint = new EndpointDefinition();
                }
            }

            // check if a wsdl 2.0 document is supplied inline
            OMElement descriptionElement = wsdlElement.getFirstChildWithName
View Full Code Here

        DefaultEndpoint defaultEndpoint = (DefaultEndpoint) endpoint;

        serializeCommonAttributes(defaultEndpoint,endpointElement);
       
        EndpointDefinition epAddress = defaultEndpoint.getDefinition();
        OMElement defaultElement = serializeEndpointDefinition(epAddress);
        endpointElement.addChild(defaultElement);

        // serialize the properties
        serializeProperties(defaultEndpoint, endpointElement);
View Full Code Here

        }

        OMElement defaultElement = epConfig.getFirstChildWithName(
                new QName(SynapseConstants.SYNAPSE_NAMESPACE, "default"));
        if (defaultElement != null) {
            EndpointDefinition endpoint = createEndpointDefinition(defaultElement);
            defaultEndpoint.setDefinition(endpoint);
            processAuditStatus(endpoint, defaultEndpoint.getName(),defaultElement);
        }

        processProperties(defaultEndpoint, epConfig);
View Full Code Here

TOP

Related Classes of org.apache.synapse.endpoints.EndpointDefinition

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.