Examples of Webservices


Examples of com.sun.enterprise.tools.common.dd.webservice.Webservices

        try {
            in = new FileInputStream(webservices);
        } catch(FileNotFoundException fne) {
            throw new RepositoryException(fne);
        }
        Webservices webServices = null;
        webServices = Webservices.createGraph(in);

        // bundle name is null for stand alone module
        boolean isAppStandAloneModule = (bundleName==null) ? true : false;

        // all web service endpoints
        WebserviceDescriptionType[] wsdts =
                webServices.getWebserviceDescription();

        ArrayList aList = new ArrayList();
        String uri = null, implName = null, implType = null, implClass = null;
        Map wsWebMap = null, wsEjbMap = null;
View Full Code Here

Examples of com.sun.enterprise.tools.common.dd.webservice.Webservices

            String pcName) {

        FileInputStream fis = null;
        try {
            fis = new FileInputStream(new File(webservicesXML));
            Webservices ws = Webservices.createGraph(fis);
            WebserviceDescriptionType[] wsdt = ws.getWebserviceDescription();
            for (int i=0; i<wsdt.length; i++) {
                PortComponentType[] pct = wsdt[i].getPortComponent();
                for (int j=0; j<pct.length; j++) {
                    String name = pct[j].getPortComponentName();
                    if (pcName.equals(name)) {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

            return;
        }

        // parse the webservices.xml file
        Map<URL,JavaWsdlMapping> jaxrpcMappingCache = new HashMap<URL,JavaWsdlMapping>();
        Webservices webservices = ReadDescriptors.readWebservices(webservicesUrl);
        wsModule.setWebservices(webservices);
        if ("file".equals(webservicesUrl.getProtocol())) {
            wsModule.getWatchedResources().add(URLs.toFilePath(webservicesUrl));
        }

        // parse any jaxrpc-mapping-files mentioned in the webservices.xml file
        for (WebserviceDescription webserviceDescription : webservices.getWebserviceDescription()) {
            String jaxrpcMappingFile = webserviceDescription.getJaxrpcMappingFile();
            if (jaxrpcMappingFile != null) {
                URL jaxrpcMappingUrl;
                try {
                    jaxrpcMappingUrl = new URL(moduleUrl, jaxrpcMappingFile);
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

        }
    }

    private void processPorts(WebModule webModule) throws OpenEJBException {
        // map existing webservice port declarations by servlet link
        Webservices webservices = webModule.getWebservices();
        Map<String, PortComponent> portMap = new TreeMap<String, PortComponent>();
        if (webservices != null) {
            for (WebserviceDescription webserviceDescription : webservices.getWebserviceDescription()) {
                for (PortComponent portComponent : webserviceDescription.getPortComponent()) {
                    ServiceImplBean serviceImplBean = portComponent.getServiceImplBean();
                    if (serviceImplBean != null && serviceImplBean.getServletLink() != null) {
                        portMap.put(serviceImplBean.getServletLink(), portComponent);
                    }
                }
            }
        }


        // map existing servlet-mapping declarations
        WebApp webApp = webModule.getWebApp();
        Map<String, ServletMapping> servletMappings = new TreeMap<String, ServletMapping>();
        for (ServletMapping servletMapping : webApp.getServletMapping()) {
            servletMappings.put(servletMapping.getServletName(), servletMapping);
        }

        // add port declarations for webservices
        WebserviceDescription webserviceDescription;
        for (Servlet servlet : webApp.getServlet()) {
            String className = servlet.getServletClass();

            // Skip JSPs
            if (className == null) continue;

            try {
                Class<?> clazz = webModule.getClassLoader().loadClass(className);
                if (JaxWsUtils.isWebService(clazz)) {
                    // add servlet mapping if not already declared
                    ServletMapping servletMapping = servletMappings.get(servlet.getServletName());
                    String serviceName = JaxWsUtils.getServiceName(clazz);
                    if (servletMapping == null) {
                        servletMapping = new ServletMapping();
                        servletMapping.setServletName(servlet.getServletName());

                        String location = "/" + serviceName;
                        servletMapping.getUrlPattern().add(location);
                        webApp.getServletMapping().add(servletMapping);
                    }

                    // if we don't have a webservices document yet, we're gonna need one now
                    if (webservices == null) {
                        webservices = new Webservices();
                        webModule.setWebservices(webservices);
                    }

                    // add web service description element (maps to service)
                    webserviceDescription = webservices.getWebserviceDescriptionMap().get(serviceName);
                    if (webserviceDescription == null) {
                        webserviceDescription = new WebserviceDescription();
                        webserviceDescription.setWebserviceDescriptionName(serviceName);
                        webservices.getWebserviceDescription().add(webserviceDescription);
                    }

                    // define port if not already declared
                    PortComponent portComponent = portMap.get(servlet.getServletName());
                    if (portComponent == null) {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

        }
    }

    private void processPorts(EjbModule ejbModule) throws OpenEJBException {
        // map existing webservice port declarations by servlet link
        Webservices webservices = ejbModule.getWebservices();
        Map<String, PortComponent> portMap = new TreeMap<String, PortComponent>();
        if (webservices != null) {
            for (WebserviceDescription webserviceDescription : webservices.getWebserviceDescription()) {
                for (PortComponent portComponent : webserviceDescription.getPortComponent()) {
                    ServiceImplBean serviceImplBean = portComponent.getServiceImplBean();
                    if (serviceImplBean != null && serviceImplBean.getEjbLink() != null) {
                        portMap.put(serviceImplBean.getEjbLink(), portComponent);
                    }
                }
            }
        }

        Map<String, EjbDeployment> deploymentsByEjbName = ejbModule.getOpenejbJar().getDeploymentsByEjbName();

        WebserviceDescription webserviceDescription = null;
        for (EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
            // skip if this is not a webservices endpoint
            if (!(enterpriseBean instanceof SessionBean)) continue;
            SessionBean sessionBean = (SessionBean) enterpriseBean;
            if (sessionBean.getSessionType() == SessionType.STATEFUL) continue;
            if (sessionBean.getServiceEndpoint() == null) continue;


            EjbDeployment deployment = deploymentsByEjbName.get(sessionBean.getEjbName());
            if (deployment == null) continue;

            Class<?> ejbClass;
            try {
                ejbClass = ejbModule.getClassLoader().loadClass(sessionBean.getEjbClass());
            } catch (ClassNotFoundException e) {
                throw new OpenEJBException("Unable to load ejb class: " + sessionBean.getEjbClass(), e);
            }

            // for now, skip all non jaxws beans
            if (!JaxWsUtils.isWebService(ejbClass)) continue;

            // create webservices dd if not defined
            if (webservices == null) {
                webservices = new Webservices();
                ejbModule.setWebservices(webservices);
            }
            if (webserviceDescription == null) {
                webserviceDescription = new WebserviceDescription();
                if (JaxWsUtils.isWebService(ejbClass)) {
                    webserviceDescription.setWebserviceDescriptionName(JaxWsUtils.getServiceName(ejbClass));
                } else {
                    // todo create webserviceDescription name using some sort of jaxrpc data
                }
                webservices.getWebserviceDescription().add(webserviceDescription);
            }

            // add a port component if we don't alrady have one
            PortComponent portComponent = portMap.get(sessionBean.getEjbName());
            if (portComponent == null) {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

            return false;
        }
    }

    public static Webservices readWebservices(URL url) throws OpenEJBException {
        Webservices webservices;
        try {
            webservices = (Webservices) JaxbJavaee.unmarshal(Webservices.class, url.openStream());
        } catch (SAXException e) {
            throw new OpenEJBException("Cannot parse the webservices.xml file: " + url.toExternalForm(), e);
        } catch (JAXBException e) {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

            return;
        }

        // parse the webservices.xml file
        final Map<URL, JavaWsdlMapping> jaxrpcMappingCache = new HashMap<URL, JavaWsdlMapping>();
        final Webservices webservices = ReadDescriptors.readWebservices(webservicesUrl);
        wsModule.setWebservices(webservices);
        if ("file".equals(webservicesUrl.getProtocol())) {
            wsModule.getWatchedResources().add(URLs.toFilePath(webservicesUrl));
        }

        // parse any jaxrpc-mapping-files mentioned in the webservices.xml file
        for (final WebserviceDescription webserviceDescription : webservices.getWebserviceDescription()) {
            final String jaxrpcMappingFile = webserviceDescription.getJaxrpcMappingFile();
            if (jaxrpcMappingFile != null) {
                final URL jaxrpcMappingUrl;
                try {
                    jaxrpcMappingUrl = new URL(moduleUrl, jaxrpcMappingFile);
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

            return in.getLength() == 0;
        }
    }

    public static Webservices readWebservices(URL url) throws OpenEJBException {
        Webservices webservices;
        try {
            webservices = (Webservices) JaxbJavaee.unmarshalJavaee(Webservices.class, IO.read(url));
        } catch (SAXException e) {
            throw new OpenEJBException("Cannot parse the webservices.xml file: " + url.toExternalForm(), e);
        } catch (JAXBException e) {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

        }
        return portMap;
    }

    public static Map<String,PortInfo> parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Webservices webservices = getWebservices(wsDDUrl);
        if (webservices instanceof Webservices) {
            Webservices webServices = (Webservices)webservices;
            return parseWebServiceDescriptor(webServices, moduleFile, isEJB, servletLocations);
//        } else if (webservices instanceof org.apache.geronimo.xbeans.javaee6.Webservices) {
//            Webservices webServices = (org.apache.geronimo.xbeans.javaee6.Webservices)webservices;
//            return parseWebServiceDescriptor2(webservices, moduleFile, isEJB, servletLocations);
        } else {
View Full Code Here

Examples of org.apache.openejb.jee.Webservices

        if (wsDDUrl != null) {
            InputStream in = null;
            try {
                in = wsDDUrl.openStream();

                Webservices wst = (Webservices) JaxbJavaee.unmarshalJavaee(Webservices.class, in);
                for (WebserviceDescription desc : wst.getWebserviceDescription()) {
                    String wsdlFile = null;
                    if (desc.getWsdlFile() != null) {
                        wsdlFile = getString(desc.getWsdlFile());
                    }
                    String serviceName = desc.getWebserviceDescriptionName();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.