axis2如何使用自己的参数名

ypz32 2012-08-28 12:53:04
我自己发布的axis2,访问wsdl看到如下,参数被自动命名为args0...:
<xs:element name="args0" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="args1" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="args2" type="xs:string" nillable="true" minOccurs="0"/>
别人的机器发布的看到的正常:
<xs:element name="towerX" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="towerY" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="towerID" type="xs:string" nillable="true" minOccurs="0"/>

这是为什么,请赐教?

环境:myeclipse 9,tomcat 6(*64),windows 7(*64),axis2
...全文
338 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wms821 2012-09-03
  • 打赏
  • 举报
回复
AXIS2默认生成的wsdl文件中所有的方法参数是args0,args1...等等;
要使wsdl文件中的方法参数显示为webservice接口中的实际的参数名称,
需要对webservice接口中的方法参数用@WebPara(name="参数名称")进行注解;
(提示: 是对接口定义的方法参数进行注解, 而不是对实现类的方法参数进行注解);
例如:webservice的认证接口定义:
public interface AuthService
{
public UserToken auth(@WebParam(name="userName") String userName, @WebParam(name="password") String password) throws ServiceException;
}
ypz32 2012-08-28
  • 打赏
  • 举报
回复
[Quote=引用楼主 的回复:]
我自己发布的axis2,访问wsdl看到如下,参数被自动命名为args0...:
<xs:element name="args0" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="args1" type="xs:string" nillable="true" minOccurs="0"/>
<xs:el……
[/Quote]
发现加上@WebParam(name="bustab030Strings")参数名就能不自动命名,但别人机器上为什么不用加这个,求解?
ypz32 2012-08-28
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

信息太少,所以估计没啥人愿意回复,都没说你是怎么定义和发布服务的。
[/Quote]
刚接触java,中途搞的这个,接口定义如下:
/**
* 接口说明
*
* @param imei
* @return
*/
public short pdaExit(String imei);

发布用的是Axis2 Service Archiver。axis2的war包是1.61版本
cxw3152 2012-08-28
  • 打赏
  • 举报
回复
么明白你具体的意思。。
MiceRice 2012-08-28
  • 打赏
  • 举报
回复
信息太少,所以估计没啥人愿意回复,都没说你是怎么定义和发布服务的。
ypz32 2012-08-28
  • 打赏
  • 举报
回复
为什么没有回复,求助啊

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧