Examples of WebserviceDescriptionType


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

        String uri = null, implName = null, implType = null, implClass = null;
        Map wsWebMap = null, wsEjbMap = null;

        // get all web services in this module
        for (int wsCnt =0; wsCnt < wsdts.length; wsCnt++) {
                WebserviceDescriptionType wsdt = wsdts[wsCnt];

                String wsdl = null;
                String wsdlFile = null;
                String mappingFileName = null;
                String mapping = null;
                if (wsdt != null) {
                    wsdl = bundleRoot + File.separator + wsdt.getWsdlFile();
                    String mapFile = wsdt.getJaxrpcMappingFile();
                    if (mapFile == null) {
                        mappingFileName = null;
                    } else {
                        mappingFileName = bundleRoot + File.separator + mapFile;
                    }
                }

                J2EEModule j2eeModule = new J2EEModule();
                try {
                    if (mappingFileName != null) {
                        mapping = j2eeModule.getStringForDDxml(mappingFileName);
                    }
                } catch (Exception e ) {
                  //_logger.log(Level.FINE,"Error reading dd file contents", e);
                }

                try {
                    if(wsdl != null) {
                        wsdlFile = j2eeModule.getStringForDDxml(wsdl);
                    }
                } catch (Exception e ) {
                  //_logger.log(Level.FINE,"Error reading dd file contents", e);
                }

                // get all ports inside this web service.
                PortComponentType pts[] = wsdt.getPortComponent();
                for (int portCnt =0; portCnt < pts.length; portCnt++) {
                    PortComponentType pt = pts[portCnt];
                    ServiceImplBeanType beanType = pt.getServiceImplBean();
                   
                    WebServiceDescrInfo wsDescrInfo = null;
View Full Code Here

Examples of com.sun.java.xml.ns.j2Ee.WebserviceDescriptionType

   }

   private WebserviceDescriptionType getWebserviceDescription( WebserviceDescriptionType[] wsDescArray,
                                                               String                      wsDescName )
   {
      WebserviceDescriptionType wsDesc = null;
      for ( int i = 0; i < wsDescArray.length; i++ )
      {
         if ( wsDescArray[i].getWebserviceDescriptionName(  ).getStringValue(  ).equals( wsDescName ) )
         {
            wsDesc = wsDescArray[i];
View Full Code Here

Examples of com.sun.java.xml.ns.j2Ee.WebserviceDescriptionType

   {
      WebserviceDescriptionType[] wsDescArray       = webservices.getWebserviceDescriptionArray(  );
      WebserviceDescriptionType[] targetWsDescArray = targetWebservices.getWebserviceDescriptionArray(  );
      for ( int i = 0; i < wsDescArray.length; i++ )
      {
         WebserviceDescriptionType wsDesc       = wsDescArray[i];
         String                    wsDescName   = wsDesc.getWebserviceDescriptionName(  ).getStringValue(  );
         WebserviceDescriptionType targetWsDesc = getWebserviceDescription( targetWsDescArray, wsDescName );
         if ( targetWsDesc == null )
         {
            targetWsDesc = targetWebservices.addNewWebserviceDescription(  );
         }

         targetWsDesc.set( wsDesc );
      }
   }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                String servletLocation;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    servletLocation = (String) servletLocations.get(linkName);
                    servletLocation = schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = null;
                try {
                    contextURI = new URI(servletLocation);
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct URI for web service location", e);
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType

     */
    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
        Map portMap = new HashMap();
        WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
        for (int i = 0; i < webserviceDescriptions.length; i++) {
            WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i];
            URI wsdlURI = null;
            try {
                wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e);
            }
            URI jaxrpcMappingURI = null;
            try {
                jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
            }
            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
            Map wsdlPortMap = schemaInfoBuilder.getPortMap();

            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
            HashMap seiMappings = new HashMap();
            ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
            for (int j = 0; j < mappings.length; j++) {
                ServiceEndpointInterfaceMappingType seiMapping = mappings[j];
                seiMappings.put(seiMapping.getServiceEndpointInterface().getStringValue(), seiMapping);
            }

//            Map portLocations = new HashMap();
            PortComponentType[] portComponents = webserviceDescription.getPortComponentArray();
            for (int j = 0; j < portComponents.length; j++) {
                PortComponentType portComponent = portComponents[j];
                String portComponentName = portComponent.getPortComponentName().getStringValue().trim();
                QName portQName = portComponent.getWsdlPort().getQNameValue();
                String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim();
                ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean();
                if (isEJB == serviceImplBeanType.isSetServletLink()) {
                    throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB ? "EJB" : "POJO(Servlet)"));
                }
                String linkName;
                if (serviceImplBeanType.isSetServletLink()) {
                    linkName = serviceImplBeanType.getServletLink().getStringValue().trim();
                    String servletLocation = (String) servletLocations.get(linkName);
                    if (servletLocation == null) {
                        throw new DeploymentException("No servlet mapping for port " + portQName);
                    }
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), servletLocation);
                } else {
                    linkName = serviceImplBeanType.getEjbLink().getStringValue().trim();
                    schemaInfoBuilder.movePortLocation(portQName.getLocalPart(), null);
                }
                PortComponentHandlerType[] handlers = portComponent.getHandlerArray();

                Port port = (Port) wsdlPortMap.get(portQName.getLocalPart());
                if (port == null) {
                    throw new DeploymentException("No WSDL Port definition for port-component " + portComponentName);
                }

                ServiceEndpointInterfaceMappingType seiMapping = (ServiceEndpointInterfaceMappingType) seiMappings.get(seiInterfaceName);

                String wsdlLocation = webserviceDescription.getWsdlFile().getStringValue().trim();
                URI contextURI = getAddressLocation(port);

                PortInfo portInfo = new PortInfo(portComponentName, portQName, schemaInfoBuilder, javaWsdlMapping, seiInterfaceName, handlers, port, seiMapping, wsdlLocation, contextURI);

                if (portMap.put(linkName, portInfo) != null) {
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.