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);
}
}