Example usage for javax.xml.ws Endpoint setProperties

List of usage examples for javax.xml.ws Endpoint setProperties

Introduction

In this page you can find the example usage for javax.xml.ws Endpoint setProperties.

Prototype

public abstract void setProperties(Map<String, Object> properties);

Source Link

Document

Sets the property bag for this Endpoint instance.

Usage

From source file:org.nuxeo.ecm.platform.api.ws.WSEndpointDescriptor.java

public Endpoint toEndpoint() throws IOException, IllegalAccessException, InstantiationException {
    Endpoint ep = Endpoint.create(getImplementorInstance());
    List<Source> metadata = new ArrayList<>();
    Map<String, Object> properties = new HashMap<>();

    if (!isBlank(port)) {
        properties.put(WSDL_PORT, new QName(namespace, port));
    }//from   w  w  w  .j  a  v  a2  s  .c o m
    if (!isBlank(port)) {
        properties.put(WSDL_SERVICE, new QName(namespace, service));
    }

    if (!isBlank(wsdl)) {
        URL wsdlURL = WSEndpointManagerImpl.class.getClassLoader().getResource(wsdl);
        if (wsdlURL == null) {
            throw new FileNotFoundException("WSDL: " + wsdl);
        }
        Source src = new StreamSource(wsdlURL.openStream());
        src.setSystemId(wsdlURL.toExternalForm());
        metadata.add(src);
    }

    if (isBlank(publishedEndpointUrl)) {
        publishedEndpointUrl = String.format("%s%s%s", Framework.getProperty(NUXEO_URL),
                WSEndpointManager.WS_SERVLET, address);
    }
    properties.put("publishedEndpointUrl", publishedEndpointUrl);

    ep.setMetadata(metadata);
    ep.setProperties(properties);
    return ep;
}

From source file:org.rifidi.edge.core.utilities.JaxWsServiceExporter.java

/**
 * The start method. Should be called after properties have been set. Will
 * deploy the webservice.//  w ww  . ja va2 s  . c o  m
 */
public void start() {
    if (deploy) {
        WebService annotation = service.getClass().getAnnotation(WebService.class);

        if (endpoint != null) {
            stop();
        }

        Endpoint endpoint = Endpoint.create(service);
        if (this.endpointProperties != null) {
            endpoint.setProperties(this.endpointProperties);
        }
        if (this.executor != null) {
            endpoint.setExecutor(this.executor);
        }
        if (this.host == null) {
            this.host = defaultHost;
        }
        if (this.port == null) {
            this.port = defaultPort;
        }
        fullAddress = host + ":" + port + "/" + annotation.serviceName();
        endpoint.publish(fullAddress);
        logger.info("Web Service published: " + fullAddress);
        this.endpoint = endpoint;

    }
}