资源预览内容
第1页 / 共8页
第2页 / 共8页
第3页 / 共8页
第4页 / 共8页
第5页 / 共8页
第6页 / 共8页
第7页 / 共8页
第8页 / 共8页
亲,该文档总共8页全部预览完了,如果喜欢就下载吧!
资源描述
eclipse根据wsdl文件生成webservice客户端一、 前期准备:11、配置log4j12、log4j使用jar包:23、wsdl使用jar包:2二、 开始生成文件:2一、 前期准备:1、配置log4j没有配置的场合提示下列的信息(可以不配置):(log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).log4j:WARN Please initialize the log4j system properly.Error: Missing argument to option -p)log4j.properties文件内容:log4j.rootLogger=info,stdout,R# # Console Appender #log4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.Target=System.outlog4j.appender.stdout.layout=org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern=%XLKV %dyyyy-MM-dd HH:mm:ss,SSS %c %t %L %p - %m%n# # File Appender # log4j.appender.R=org.apache.log4j.DailyRollingFileAppender#log4j.appender.R.File=$WORKDIR/TestWebService/WebRoot/logs/out.log#log4j.appender.R.File=$catalina.home/WebRoot/logs/out.loglog4j.appender.R.File=D:/logs/TestWebService.loglog4j.appender.R.DatePattern = .yyyy-MM-ddlog4j.appender.R.layout=org.apache.log4j.PatternLayoutlog4j.appender.R.layout.ConversionPattern=%XLKV %dyyyy-MM-dd HH:mm:ss,SSS %c %t %L %p - %m%n# # log level# log4j.logger.com.ibatis=debuglog4j.logger.com.ibatis.common.jdbc.SimpleDataSource=debuglog4j.logger.com.ibatis.common.jdbc.ScriptRunner=debuglog4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=debuglog4j.logger.java.sql.Connection=debuglog4j.logger.java.sql.Statement=debuglog4j.logger.java.sql.PreparedStatement=debug,stdoutlog4j.logger.java.sql.PreparedStatement=debug,stdout,Rlog4j.logger.com.jiahelife=debuglog4j.logger.com.jiahelife.platform=error2、log4j使用jar包:log4j-1.2.8.jarcommons-discovery-0.2.jarcommons-logging.jar3、wsdl使用jar包:axis.jarwsdl4j-1.5.1.jar二、 开始生成文件:具体操作如下图:选中Include libraries when searching for a main class复选框;然后点击Search按钮进入如下的画面,在输入框中输入WSDL2Java点击【OK】按钮进入下图:点击Arguments的页面,进行如下设置:21说明:1、WSDL文件生成的XML文件 2、XML文件所在工作目录,以及生成后java文件的存放目录。点击【Run】后生成文件。三、项目结构图:com文件夹就是生成后的wsdl代码。四、补充说明1、arguments标签栏里输入参数参考: -h, -help print this message and exit -v, -verbose print informational messages -n, -noImports only generate code for the immediate WSDL document -O, -timeout timeout in seconds (default is 45, specify -1 to disable) -D, -Debug print debug information -W, -noWrapped turn off support for wrapped document/literal -q, -quiet do not print any informational or debug messages (except err ors) -s, -server-side emit server-side bindings for web service -S, -skeletonDeploy deploy skeleton (true) or implementation (false) in deploy.w sdd. Default is false. Assumes -server-side. -N, -NStoPkg = mapping of namespace to package -f, -fileNStoPkg file of NStoPkg mappings (default NStoPkg.properties) -p, -package override all namespace to package mappings, use this package name instead -o, -output output directory for emitted files -d, -deployScope add scope to deploy.wsdd: Application, Request, Session -t, -testCase emit junit testcase class for web service -a, -all generate code for all elements, even unreferenced ones -T, -typeMappingVersion indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC c ompliant. 1.2 indicates SOAP 1.1 encoded.) -F, -factory name of a custom class that implements GeneratorFactory inte rface (for extending Java generation functions) -H, -helperGen emits separate Helper classes for meta data -B, -buildFile emit Ant Buildfile for web service -U, -user username to access the WSDL-URI -P, -password password to access the WSDL-URI -X, -classpath additional classpath elements -i, -nsInclude include namespace in generated code -x, -nsExclude exclude namespace from generated code -c, -implementationClassName custom name of web service implementation -u, -allowInvalidURL emit file even if WSDL endpoint URL is not a valid URL -w, -wrapArrays Prefers building beans to straight arrays for wrapped XML ar ray types (defaults to off).
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号