Package org.apache.openejb.core.webservices

Examples of org.apache.openejb.core.webservices.PortData


                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, deploymentInfo.getInjections(), moduleBaseUrl, deploymentInfo.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, deploymentInfo);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = deploymentInfo.getClassLoader();
                            if (wsRegistry != null) {
                                // add servlet to web container
                                List<String> addresses = wsRegistry.addWsContainer(location, container, virtualHost, realmName, transportGuarantee, authMethod, classLoader);

                                // one of the registered addresses to be the connonical address
                                String address = selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(), e);
View Full Code Here


                ClassLoader classLoader = deploymentInfo.getClassLoader();
                Collection<Injection> injections = deploymentInfo.getInjections();
                Context context = deploymentInfo.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = beanContext.getClassLoader();
                            if (wsRegistry != null) {
                                String auth = authMethod;
                                String realm = realmName;
                                String transport = transportGuarantee;

                                if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                    auth = portInfo.authMethod;
                                    realm = portInfo.realmName;
                                    transport = portInfo.transportGuarantee;
                                }

                                String context = webContextByEjb.get(bean.ejbClass);
                                if (context == null && !OLD_WEBSERVICE_DEPLOYMENT) {
                                    context = ejbJar.moduleName;
                                }
                                List<String> addresses = wsRegistry.addWsContainer(context, location, container, virtualHost, realm, transport, auth, classLoader);

                                // one of the registered addresses to be the canonical address
                                String address = HttpUtil.selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying JAX-WS Web Service for EJB " + beanContext.getDeploymentID(), e);
View Full Code Here

                ClassLoader classLoader = webContext.getClassLoader();
                Collection<Injection> injections = webContext.getInjections();
                Context context = webContext.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = HttpUtil.selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = beanContext.getClassLoader();
                            if (wsRegistry != null) {
                                String auth = authMethod;
                                String realm = realmName;
                                String transport = transportGuarantee;

                                if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                    auth = portInfo.authMethod;
                                    realm = portInfo.realmName;
                                    transport = portInfo.transportGuarantee;
                                }

                                List<String> addresses = wsRegistry.addWsContainer(webContextByEjb.get(bean.ejbClass), location, container, virtualHost, realm, transport, auth, classLoader);

                                // one of the registered addresses to be the cannonical address
                                String address = HttpUtil.selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying JAX-WS Web Service for EJB " + beanContext.getDeploymentID(), e);
View Full Code Here

                ClassLoader classLoader = webContext.getClassLoader();
                Collection<Injection> injections = webContext.getInjections();
                Context context = webContext.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = HttpUtil.selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

import java.net.URL;
import java.net.MalformedURLException;

public class WsBuilder {
    public static PortData toPortData(PortInfo port, Collection<Injection> injections, URL baseUrl, ClassLoader classLoader) throws OpenEJBException {
        PortData portData = new PortData();
        portData.setPortId(port.portId);
        if (port.serviceName != null && port.serviceName.length() != 0) {
            portData.setServiceName(QName.valueOf(port.serviceName));
        }
        if (port.portName != null && port.portName.length() != 0) {
            portData.setPortName(QName.valueOf(port.portName));
        }
        portData.setWsdlUrl(getWsdlURL(port.wsdlFile, baseUrl, classLoader));
        portData.getHandlerChains().addAll(toHandlerChainData(port.handlerChains, classLoader));
        portData.getInjections().addAll(injections);
        portData.setMtomEnabled(port.mtomEnabled);
        portData.setBindingID(port.binding);
        portData.setWsdlPort(port.wsdlPort);
        portData.setWsdlService(port.wsdlService);
        portData.setLocation(port.location);

        portData.setSecure("WS-SECURITY".equals(port.authMethod));
        if (portData.isSecure()) {
      portData.setSecurityProperties(port.properties);
  }

        return portData;
    }
View Full Code Here

                        PortInfo portInfo = ports.get(bean.ejbName);
                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                            }
                            if (!location.startsWith("/")) location = "/" + location;
                            ejbLocations.put(bean.ejbDeploymentId, location);

                            ClassLoader classLoader = beanContext.getClassLoader();
                            if (wsRegistry != null) {
                                String auth = authMethod;
                                String realm = realmName;
                                String transport = transportGuarantee;

                                if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                    auth = portInfo.authMethod;
                                    realm = portInfo.realmName;
                                    transport = portInfo.transportGuarantee;
                                }

                                List<String> addresses = wsRegistry.addWsContainer(webContextByEjb.get(bean.ejbClass), location, container, virtualHost, realm, transport, auth, classLoader);

                                // one of the registered addresses to be the canonical address
                                String address = HttpUtil.selectSingleAddress(addresses);

                                if (address != null) {
                                    // register wsdl location
                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                    ejbAddresses.put(bean.ejbDeploymentId, address);
                                }
                            }
                        } catch (Throwable e) {
                            logger.error("Error deploying JAX-WS Web Service for EJB " + beanContext.getDeploymentID(), e);
View Full Code Here

                ClassLoader classLoader = webContext.getClassLoader();
                Collection<Injection> injections = webContext.getInjections();
                Context context = webContext.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);

                    // one of the registered addresses to be the connonical address
                    String address = HttpUtil.selectSingleAddress(addresses);

                    // add address to global registry
                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                    logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Pojo(id=" + portInfo.portId + ")");
                    servletAddresses.put(webApp.moduleId + "." + servlet.servletName, address);
                }
            } catch (Throwable e) {
                logger.error("Error deploying CXF webservice for servlet " + portInfo.serviceLink, e);
            }
View Full Code Here

                        continue;

                    final ClassLoader old = Thread.currentThread().getContextClassLoader();
                    Thread.currentThread().setContextClassLoader(beanContext.getClassLoader());
                    try {
                        final PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                        final HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext, new ServiceConfiguration(beanContext.getProperties(), appInfo.services));

                        // generate a location if one was not assigned
                        String location = port.getLocation();
                        if (location == null) {
                            location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
                        }
                        if (!location.startsWith("/"))
                            location = "/" + location;
                        ejbLocations.put(bean.ejbDeploymentId, location);

                        final ClassLoader classLoader = beanContext.getClassLoader();
                        if (wsRegistry != null) {
                            String auth = authMethod;
                            String realm = realmName;
                            String transport = transportGuarantee;

                            if ("BASIC".equals(portInfo.authMethod) || "DIGEST".equals(portInfo.authMethod) || "CLIENT-CERT".equals(portInfo.authMethod)) {
                                auth = portInfo.authMethod;
                                realm = portInfo.realmName;
                                transport = portInfo.transportGuarantee;
                            }

                            String context = webContextByEjb.get(bean.ejbClass);
                            if (context == null && !OLD_WEBSERVICE_DEPLOYMENT) {
                                context = ejbJar.moduleName;
                            }
                            final List<String> addresses = wsRegistry.addWsContainer(container, classLoader, context, virtualHost, location, realm, transport, auth);

                            // one of the registered addresses to be the canonical address
                            final String address = HttpUtil.selectSingleAddress(addresses);

                            if (address != null) {
                                // register wsdl location
                                portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
                                setWsdl(container, address);
                                logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
                                ejbAddresses.put(bean.ejbDeploymentId, address);
                                addressesForApp(appInfo.appId).add(new EndpointInfo(address, port.getWsdlService(), beanContext.getBeanClass().getName()));
                            }
                        }
                    } catch (final Throwable e) {
                        logger.error("Error deploying JAX-WS Web Service for EJB " + beanContext.getDeploymentID(), e);
                    } finally {
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.webservices.PortData

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.