Package org.jboss.ws.metadata.wsdl

Examples of org.jboss.ws.metadata.wsdl.WSDLDefinitions


   /**
    *   Generate the common WSDL definition for a given endpoint
    */
   public WSDLDefinitions generate(Class endpoint)
   {
      WSDLDefinitions wsdl = null;

      if (umd != null)
      {
         JavaToWSDLHelper helper = new JavaToWSDLHelper();
         try
         {
            helper.setPackageNamespaceMap(packageNamespaceMap);
            wsdl = handleJavaToWSDLGeneration(helper, endpoint.getName());

            typeMapping = helper.getTypeMapping();
         }
         catch (IOException e)
         {
            log.error("Error during Java->WSDL generation:", e);
         }
      }

      // This is somewhat of a hack
      if (qualifiedElements)
      {
         JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
         if (schemaModel != null)
            schemaModel.setQualifiedElements(true);
      }

      return wsdl;
View Full Code Here


   }

   //PRIVATE METHODS
   private WSDLDefinitions handleJavaToWSDLGeneration(JavaToWSDLHelper helper, String endpointName) throws IOException
   {
      WSDLDefinitions wsdl = null;
      if (umd == null)
         throw new WSException("Unified Meta Data Model is null");

      for (ServiceMetaData service : umd.getServices())
      {
View Full Code Here

         // Get the wsdl definition and write it to the wsdl publish location
         try
         {
            Writer fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
            WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
            new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);

            URL wsdlPublishURL = wsdlFile.toURL();
            log.info("WSDL published to: " + wsdlPublishURL);

            // udpate the wsdl file location
            serviceMetaData.setWsdlLocation(wsdlFile.toURL());

            // Process the wsdl imports
            Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
            if (wsdl11Definition != null)
            {
               List<String> published = new LinkedList<String>();
               publishWsdlImports(wsdlFile.toURL(), wsdl11Definition, published);

               // Publish XMLSchema imports
               Document document = wsdlDefinitions.getWsdlDocument();
               publishSchemaImports(wsdlFile.toURL(), document.getDocumentElement(), published);
            }
            else
            {
               throw new NotImplementedException("WSDL-2.0 imports");
View Full Code Here

   }

   protected WSDLDefinitions getWSDLDefinitions(File wsdlFile) throws MalformedURLException
   {
      WSDLDefinitionsFactory wsdlFactory = WSDLDefinitionsFactory.newInstance();
      WSDLDefinitions wsdlDefinitions = wsdlFactory.parse(wsdlFile.toURL());
      return wsdlDefinitions;
   }
View Full Code Here

      {
         String key = (String)keys.next();
         Boolean value = (Boolean)featureMap.get(key);
         jwsdl.addFeature(key, value.booleanValue());
      }
      WSDLDefinitions wsdl = jwsdl.generate(seiClass);
      typeMapping = jwsdl.getTypeMapping();
      return wsdl;
   }
View Full Code Here

      Element was = DOMUtils.parse(wsdlFile.toURL().openStream());
      //assertEquals(exp,was);
      //Now that we have figured out that the wsdl files are well formed,
      //lets do the semantic wsdl validation
      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
      WSDLDefinitions wsdlExp = factory.parse(wsdlfix.toURL());

      WSDLDefinitions wsdlActual = factory.parse(wsdlFile.toURL());
      WSDLValidator validator = new WSDL11Validator();
      try
      {
         bool = validator.validate(wsdlExp, wsdlActual);
         if (bool == false)
View Full Code Here

      addPolicy(new File("resources/tools/jbws1645/PortPolicy.txt"), PolicyScopeLevel.WSDL_PORT, epMetaData);
      addPolicy(new File("resources/tools/jbws1645/PortTypePolicy.txt"), PolicyScopeLevel.WSDL_PORT_TYPE, epMetaData);
      addPolicy(new File("resources/tools/jbws1645/BindingPolicy.txt"), PolicyScopeLevel.WSDL_BINDING, epMetaData);
     
      //generate the wsdl definitions and write the wsdl file
      WSDLDefinitions wsdl = jwsdl.generate(seiClass);
     
      //performe some trivial checks on wsdl definitions
      assertEquals(1, wsdl.getServices()[0].getEndpoints()[0].getExtensibilityElements(
            Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
      assertNotNull(wsdl.getInterfaces()[0].getProperty(Constants.WSDL_PROPERTY_POLICYURIS));
      assertEquals(1, wsdl.getBindings()[0].getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
      assertEquals(3, wsdl.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY).size());
     
      Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
      new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
      fw.close();
     
View Full Code Here

      addPolicy(new File("resources/tools/jbws1645/PortTypePolicy.txt"), PolicyScopeLevel.WSDL_PORT_TYPE, epMetaData);
      addPolicy(new File("resources/tools/jbws1645/BindingPolicy.txt"), PolicyScopeLevel.WSDL_BINDING, epMetaData);
      addPolicy(new File("resources/tools/jbws1645/BindingPolicy2.txt"), PolicyScopeLevel.WSDL_BINDING, epMetaData);
     
      //generate the wsdl definitions and write the wsdl file
      WSDLDefinitions wsdl = jwsdl.generate(seiClass);
     
      //performe some trivial checks on wsdl definitions
      assertEquals(2, wsdl.getServices()[0].getEndpoints()[0].getExtensibilityElements(
            Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
      assertNotNull(wsdl.getInterfaces()[0].getProperty(Constants.WSDL_PROPERTY_POLICYURIS));
      assertEquals(2, wsdl.getBindings()[0].getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
      assertEquals(6, wsdl.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY).size());
     
      Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
      new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
      fw.close();
     
View Full Code Here

      JavaToWSDL jwsdl = new JavaToWSDL(Constants.NS_WSDL11);
      jwsdl.setServiceName(sname);
      jwsdl.setTargetNamespace("http://org.jboss.ws");
      jwsdl.addFeature(WSToolsConstants.WSTOOLS_FEATURE_RESTRICT_TO_TARGET_NS, true);
      jwsdl.setStyle(Style.RPC);
      WSDLDefinitions wsdl = jwsdl.generate(seiClass);

      Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
      new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
      fw.close();
View Full Code Here

      });

      assertEquals("WSDL files found", 1, wsdls.length);

      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
      WSDLDefinitions wsdl;
      try
      {
         wsdl = factory.parse(wsdls[0].toURL());
      }
      catch (MalformedURLException e)
      {
         throw new JBWS1190Exception("Error readin WSDL", e);
      }

      WSDLService[] services = wsdl.getServices();
      assertEquals("No of services", 1, services.length);

      WSDLEndpoint[] endpoints = services[0].getEndpoints();
      assertEquals("No of endpoints", 1, endpoints.length);
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsdl.WSDLDefinitions

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.