4 ways to generate a Webservice client

1. Use Axis to produce client code (save as a bat file)

many times before because the directory contains spaces such as Axis_Lib, Output_Path
[java] view plain copy

    set Axis_Lib=F:\axis1.4\axis\WEB-INF\lib 
            set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%     
            set Output_Path=D:\Workspaces 
            set Package=com.axis.sub 
            %Java_Cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package % http://192.168.11.62:8090/rainLogin?wsdl 
            pause 


2 Use wsimport.exe of JDK1.6 to generate client code (before adding the JDK bin to the environment variable Path)


[html] view plain copy

    wsimport - keep -p com.jdk6.sub -s JavaSrc http://192.168.11.62:8090/rainLogin?wsdl 

[html] view plain copy

    -s(src): in the JavaSrc (to be manually created) folder under the current path Generate client code 
    -p(package): define the package name of the client code  -keep keep the
    .class file  , the client code will be generated under src [html] view plain copy     wsdl2java http://192.168.11.62:8080/FFWebservice/services/PortalServices?wsdl  4 Use Myeclipse's own tools to generate client code Create a new Java project, right click Create another project, select Web Service Client of web services, and fill in the wsdl address in Service definition, such as: http://192.168.11.62:8080/FFWebservice/services/PortalServices?wsdl finnish can generate client code.




















Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326894672&siteId=291194637