WSDL2Java 命令:
语法:
wsdl2java -fe <frontend name>* -db <data binding name>* -wv <[wsdl version]>*
-p <[wsdl namespace =]Package Name>* -sn <service-name> -b <binding-name>*
-catalog <catalog-file-name> -d <output-directory> -compile
-classdir <compile-classes-directory> -impl -server -client -all
-autoNameResolution -defaultValues<=class name for DefaultValueProvider> -ant
-nexclude <schema namespace [= java packagename]>* -exsh <(true, false)>
-dns <(true, false)> -dex <(true, false)> -validate -keep
-wsdlLocation <wsdlLocation attribute> -xjc<xjc arguments> -noAddressBinding -h
-v -verbose -quiet <wsdlurl>
命令描述:
wsdl2java takes a WSDL document and generates fully annotated Java code from which to implement a service.
The WSDL document must have a valid portType element, but it does not need to contain a binding element or a service
element. Using the optional arguments you can customize the generated code. In addition, wsdl2java can generate an Ant
based makefile to build your application.
例子:
wsdl2java HelloWorld.wsdl
wsdl2java -p com.iona.greeting Greeting.wsdl
wsdl2java -client HelloWorld.wsdl
参数详细:
The arguments used to manage the code generation process are reviewed in the following table.
Option Interpretation
-? Displays the online help for this utility.
-help Displays the online help for this utility.
-h Displays the online help for this utility.
-fe frontend-name Specifies the frontend. Default is JAXWS. Currently supports only JAXWS frontend.
-db databinding-name Specifies the databinding. Default is jaxb. Currently supports jaxb and xmlbeans databinding. sdo (sdo-static and sdo-dynamic) supported in 2.3.
-wv wsdl-version Specifies the wsdl version .Default is WSDL1.1. Currently suppports only WSDL1.1 version.
-p [ wsdl-namespace= ] PackageName Specifies zero, or more, package names to use for the generated code. Optionally specifies the WSDL namespace to package name mapping.
-sn service-name The WSDL service name to use for the generated code.
-b binding-name Specifies JAXWS or JAXB binding files or XMLBeans context files. Use multiple -b flags to specify multiple entries.
-catalog catalog-file-name Specify catalog file to map the imported wsdl/schema
-d output-directory Specifies the directory into which the generated code files are written.
-compile Compiles generated Java files.
-classdir complile-class-dir Specifies the directory into which the compiled class files are written.
-client Generates starting point code for a client mainline.
-server Generates starting point code for a server mainline.
-impl Generates starting point code for an implementation object.
-all Generates all starting point code: types, service proxy, service interface, server mainline, client mainline, implementation object, and an Ant build.xml file.
-ant Generates the Ant build.xml file.
-autoNameResolution Automatically resolve naming conflicts without requiring the use of binding customizations.
-defaultValues=[DefaultValueProvider impl] Specifies that default values are generated for the impl and client. You can also provide a custom default value provider. The default provider is RandomValueProvider
-nexclude schema-namespace [=java-packagename] Ignore the specified WSDL schema namespace when generating code. This option may be specified multiple times. Also, optionally specifies the Java package name used by types described in the excluded namespace(s).
-exsh (true/false) Enables or disables processing of implicit SOAP headers (i.e. SOAP headers defined in the wsdl:binding but not wsdl:portType section.) Default is false.
-dns (true/false) Enables or disables the loading of the default namespace package name mapping. Default is true and http://www.w3.org/2005/08/addressing=org.apache.cxf.ws.addressing namespace package mapping will be enabled.
-dex (true/false) Enables or disables the loading of the default excludes namespace mapping. Default is true.
-validate Enables validating the WSDL before generating the code.
-keep Specifies that the code generator will not overwrite any preexisting files. You will be responsible for resolving any resulting compilation issues.
-wsdlLocation wsdlLocation Specifies the value of the @WebServiceClient annotation's wsdlLocation property.
-xjc<xjc args> Specifies a comma separated list of arguments that are passed directly to the XJC processor when using the JAXB databinding. A list of available XJC plugins can be obtained using -xjc-X.
-noAddressBinding For compatibility with CXF 2.0, this flag directs the code generator to generate the older CXF proprietary WS-Addressing types instead of the JAX-WS 2.1 compliant WS-Addressing types.
-v Displays the version number for the tool.
-verbose Displays comments during the code generation process.
-quiet Suppresses comments during the code generation process.
wsdlfile The path and name of the WSDL file to use in generating the code.
分享到:
相关推荐
为了能够在命令行中直接调用 `wsdl2java` 命令,需要将 CXF 的 bin 目录添加到系统的 PATH 环境变量中: 1. 设置 `CXF_HOME` 变量指向 CXF 安装目录,例如 `D:\apache-cxf-2.7.10`。 2. 将 `%CXF_HOME%\bin` 添加到...
接下来,打开终端或命令提示符,导航到`bin`目录,该目录包含了`wsdl2java.bat`(Windows)或`wsdl2java.sh`(Unix/Linux)脚本。 使用`WSDL2Java`工具的基本语法如下: ```bash wsdl2java.sh -uri <wsdl_file> [-...
例如,运行`wsdl2java`命令并指定WSDL文件路径,就能自动生成相应的Java源码,然后编译这些源码,就可以在Java应用中直接调用Web服务了。 以上四个知识点涵盖了Java开发中数据交换、网络通信、动态内容生成和Web...
在IT行业中,Web服务是一种广泛使用的接口通信方式,它允许不同的应用程序之间进行数据交换。WSDL(Web Services ...在Apache CXF中,同样可以使用`cxf-codegen-plugin`或者`wsdl2java`命令来实现类似的功能。
wsimport命令的基本语法如下: wsimport [options] <WSDL_URI> 其中,[options]是可选参数,<WSDL_URI>是WSDL文件的URI。 常用的[options]参数有: * -d <directory>:在指定的目录生成class文件 * -clientjar ...
1. 使用`wsdl2java`命令,根据服务接口生成Java源代码。 2. 编译生成的Java源代码,确保所有依赖项已正确配置。 3. 使用`deploy`命令,将编译后的Java类打包成JAR文件,并将其发布到服务器上的Axis容器。 在博文...
`Java2WSDL`是Axis提供的一个工具,它可以读取特定的Java类,并根据类的方法签名和其他元数据生成相应的WSDL文件。这样做的目的是为了让客户端能够理解服务端提供的操作及数据结构,从而实现远程调用。 - **WSDL...
正确的命令可能是使用`wsdl2java`工具从WSDL文件生成服务相关的Java类。例如,`wsdl2java -u <URI> -d <directory> -p <package>`,其中`-u`指定WSDL的URI,`-d`指定输出目录,`-p`指定生成类的包名。 3. **...
6. **命令行工具**:描述中的"CMD命令"可能指的是 Axis提供的命令行工具,例如wsdl2java用于从WSDL生成Java代码,java2wsdl则相反,从Java类生成WSDL。 7. **错误处理**:轴心还包含了强大的错误处理机制,能够捕获...
* Struts2:MVC 与 struts 体系、Action 和 Result、国际化和标签库、文件上传、下载、类型转换和输入检验、拦截器与插件开发 * Hibernate:ORM 与持久化映射、关系映射、继承映射、延迟加载、性能调优、HQL 查询、...
**学习目标**:理解并掌握Java的基本语法、数据类型、控制结构、面向对象编程(OOP)概念等。 - **核心知识点**: - 变量、常量与数据类型 - 运算符与表达式 - 控制语句(if/else、switch、for/while循环) - ...
2. **UNIX开发环境**: 对于在UNIX平台上进行开发的开发者,掌握基本的UNIX命令和系统工作原理是必要的。这包括文件管理、进程控制、网络通信等。 3. **Oracle**: 学习Oracle数据库管理,包括SQL查询、存储过程、...
2. `QualityOpinionWSDD.java`:WSDD(Web Services Deployment Descriptor)是Apache Axis框架下用于配置Web Service的文件,它定义了服务的端点、操作、消息类型等信息。这个文件可能是WebService服务端的实现类,...
3. **Core Java (J2SE)**:深入理解Java核心语法,包括面向对象编程思想,使用Eclipse进行开发实践,掌握异常处理、I/O、多线程、Swing等高级特性。 第二学期: 1. **OOAD/UML**:学习面向对象分析与设计(OOAD),...
- "java基础要点.txt":Java基础包括语法、面向对象特性、异常处理、集合框架、多线程等内容,是Java编程的基石。 - "linux总结.txt":可能涵盖Linux命令行使用、文件系统、权限管理、进程控制、网络配置等主题。 ...
- **IBM的Java面试技巧:** 针对IBM等公司的Java面试,除了掌握基本的语法和概念外,还需要深入了解面向对象设计原则、集合框架、并发编程等内容。 #### OSI模型与TCP/IP协议 1. **OSI模型:** OSI (Open Systems ...
04 Induction to JavaScript.ppt和05 Java Script-ad.ppt可能涵盖了变量、数据类型、函数、DOM操作、事件处理、AJAX(异步JavaScript和XML)以及闭包等概念。 4. **Web Service和SOAP (Simple Object Access ...
BPEL引擎是执行这些命令的关键,它必须能够处理SOAP/WSDL/UDDI等Web服务基础协议。市面上有各种成熟度和复杂性的BPEL引擎,有些集成在企业服务总线(ESB)中,有些则是独立产品。 ActiveBPEL是一个开源的Java BPEL...
索引器本质上是一个特殊的属性,但它使用方括号语法来获取或设置值。例如: ```csharp public class MyClass { public int this[int index] { get { return values[index]; } set { values[index] = value; } } ...