使用apache-cxf-2.2.5生成WebService客户端时List属性没有Setter方法
用apache-cxf-2.2.5来生成Google Adwords WebService 的client,发现TargetingIdeaSelector类中的List属性只生成了get方法,没有set方法。
试验很多参数都不能生成List属性的setter方法。只能是先get出来一个List,然后向里面add。
想生成基于JAX-RPC的client也没找到方法。
同事zw给我发了一个link,讲到CXF就是只为List提供一个get方法
This is per jaxb spec. For collections, the jaxb spec specifically
just provides a getter, no setter. More importantly, we HAVE to have
this working with no setter in order to pass the JAX-WS TCK.
http://mail-archives.apache.org/mod_mbox/cxf-users/200801.mbox/%3C200801042107.57860.dkulp@apache.org%3E
JAX-WS 2.0 是 JAX-RPC 1.1 的后续版本,他们的一个区别是关于数据映射模型的
JAX-RPC 具有自己的映射模型,此模型大约涵盖了所有模式类型中的 90%。它没有涵盖的部分映射到了 javax.xml.soap.SOAPElement。
JAX-WS 的数据映射模型是 JAXB。JAXB 可保证所有 XML 模式的映射。
JAX-RPC会将集合映射成数组,而JAX-WS会将集合映射成List
http://www.ibm.com/developerworks/cn/webservices/ws-tip-jaxwsrpc.html
JSR 224: Java API for XML-Based Web Services (JAX-WS) 2.0
http://jcp.org/en/jsr/detail?id=224
The Java Web Services Tutorial
http://java.sun.com/webservices/docs/2.0/tutorial/doc/index.html
阅读更多
- Spring中使用事务搭建转账环境方法二 相对简便的注解方法 ——配置文件注入对象属性需要setter方法 注解方法,不需要生成setter方法
- 用apache-cxf生成webservice客户端的时候报错Parameter: shead already exists for method
- 用AXIS2发布WebService的方法 使用eclipse插件生成服务端和客户端
- 使用apache-cxf生成wsdl的客户端文件并使用
- 用AXIS2发布WebService的方法 使用eclipse插件生成服务端和客户端
- 使用CXF生成webService客户端
- 用apache-cxf生成webservice客户端的时候报错Parameter: shead already exists for method
- 使用Apache的CXF框架发布Webservice四种方法总结
- apache-cxf-2.2.4生成webservice客户端
- 使用反射获取父类的属性并设值,适用于类中没有提供setter方法
- java用axis2生成webservice客户端代码及使用方法
- 用apache-cxf生成webservice客户端的时候报错Parameter: shead already exists for method
- Spring中使用事务搭建转账环境方法二 相对简便的注解方法 ——配置文件注入对象属性需要setter方法 注解方法,不需要生成setter方法
- 使用cxf生成webservice客户端调用异常解决
- 怎样使用cxf webservice并生成客户端代码
- axis2生成webservice客户端代码及使用方法
- CXF使用教程(二)——webService自动生成客户端代码
- delphi Tstringlist的使用方法及属性
- 使用axis的stub生成webservice客户端代码
- 关于cxf 连.net 的webservice生成客户端异常( undefined element declaration 's:schema')