接口定义默认参数In0、In1...不太友好。
修改方法:
添加annotation:
@WebService
public interface Iupward {
@WebMethod
@WebResult(name="result")
public String example(@WebParam(name="message")String message);
@WebMethod
@WebResult(name="result")
public int pushMOInfo(@WebParam(name="infotype")String infotype,
@WebParam(name="mobile")String mobile,
@WebParam(name="content")String content,
@WebParam(name="msgtime")String msgtime,
@WebParam(name="note")String note);
@WebMethod
@WebResult(name="result")
public int pushMOInfos(@WebParam(name="jsonObj")String jsonObj);
}services.xml加
<serviceFactory>jsr181</serviceFactory> <service>
<name>ApplySheetService</name>
<serviceClass>sjck.service.IApplySheetService</serviceClass>
<implementationClass>
sjck.service.ApplySheetServiceImpl
</implementationClass>
<serviceFactory>jsr181</serviceFactory>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
</service>
本文详细阐述了如何通过添加@annotation来优化WebService接口中默认参数In0、In1等的设置,具体介绍了如何使用@WebMethod和@WebResult注解来定义接口方法及返回结果,并提供了几个实际应用案例。
200

被折叠的 条评论
为什么被折叠?



