2007-10-15
cxf的WebService实现中,方法不能给参数传空指针
项目中使用cxf作WebService的实现。但是在调用一个方法的时候,在客户端就出错,说是IllegalArgumentException。昨晚加班到凌晨4点,才找到原因。原来,在服务方法中有一个String类型的参数,当给这个参数传空指针的时候,就会出错。
cxf也太弱了吧?给参数传空指针就会出错,而且错误信息十分不友好。为什么不提示说是空指针呢?或者干脆就支持空指针好了。
- 10:39
- 浏览 (421)
- 评论 (1)
- 分类: WebService
- 进入论坛
- 相关推荐
评论
jnn
2007-10-15
你是采用WSDL First 还是Code First来发布你的服务的, 我记得如果采用WSDL First的话,将参数的Element设置为nillable。
还有你采用Code First的话, 可以通过JAXWS API 中Annotation 设置你的来参数的内容。
还有你采用Code First的话, 可以通过JAXWS API 中Annotation 设置你的来参数的内容。
JAXB has the ability to specify that stuff with attributes on the
XmlElement annotation. JAX-WS allows you to define a "wrapper" type
that the runtime uses to for IO. Thus, you can create the wrapper type
with the annotations that you want and then use the @RequestWrapper and
@ResponseWrapper annotations to point the JAX-WS runtime at it.
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 16637 次
- 性别:

- 来自: 上海

- 详细资料
搜索本博客
链接
最新评论
-
apachet转发请求到tomcat ...
很老的问题了,一般实际开发都是这样做的,至少我们用的tomcat5.0.28是这 ...
-- by jhj823900 -
jBPM的Scheduler模块和Sp ...
提示个方法。。用JobExecutorServlet方法来代替你的Schedul ...
-- by gabriel80 -
spring 学习日记 - 基于 ...
ms可以这样 <bean class="org.springframewo ...
-- by sgfgh -
如何实现Spring管理下的不 ...
如果是使用CFX的前身XFire时,使用的FactoryBean是org.cod ...
-- by ununreal -
如何实现Spring管理下的不 ...
引用服务端中途断掉又连上呢?应该没有影响的吧,http无状态 我的经验是如果初始 ...
-- by Frederick






评论排行榜