Generate WSDL with CXF based on Werservice code

Source: Internet
Author: User

Original: http://hongyegu.iteye.com/blog/619147, thank you!

import Org.apache.cxf.tools.java2ws.JavaToWS;
import Net.bwda.service.Busi.webservice.FileMarkService;
 Public class java2wsdl {
   Private Class<?> ClassName;  
       Public String[] ARGS1,ARGS2,ARGS3;  
      
       
       
       */  
       Public JAVA2WSDL (class<?> className) {  
          this. className = ClassName;   
            
          Generates HELLO.WSDL based on Hello.class, and the resulting WSDL file is placed in the resource directory  
          args1=New string[]{"-wsdl", "-D", "./resource", this. Classname.getname ()};  
          Depending on the hello.class generated hello.wsdl, the resulting file is placed under the root directory. Example  
          args2=New string[]{"-wsdl", "-cp", "./example",this. Classname.getname ()};  
          Generate WSDL file according to Hello.class, file named myhello.wsdl, put in root directory  
          args3=New string[]{"-o", "myhello.wsdl", "-wsdl", this. Classname.getname ()};  
      }  
      
       
       
       
       */  
       Public JAVA2WSDL (class<?> classname,string wsdlfilename) {  
          this. className = ClassName;   
            
          Generates HELLO.WSDL based on class, and the resulting WSDL file is placed in the resource directory  
          args1=New string[]{"-wsdl", "-D", "./resource", this. Classname.getname ()};  
          Based on class generation HELLO.WSDL, the resulting file is placed under the root directory. Example  
          args2=New string[]{"-wsdl", "-cp", "./example",this. Classname.getname ()};  
          Generates a WSDL file based on class, named Myhello.wsdl, placed under the root directory  
          args3=New string[]{"-o", wsdlfilename+ ". wsdl", "-wsdl", this. Classname.getname ()};  
      }  
    
       Public void java2wsdl (string[] args) {  
          New Javatows (args);  
          Try {  
              Javatows.run ();  
          Catch (Exception e) {  
              E.printstacktrace ();  
          }  
      }  
    
       Public Static void Main (string[] args) {  
          New JAVA2WSDL (Filemarkservice.  Class);  
          JAVA2WSDL.JAVA2WSDL (JAVA2WSDL.ARGS1);  
      }  
}

Generate WSDL with CXF based on Werservice code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.