Axis2 POJO 中参数数量可变
我有一个使用 Axis2/Java 构建的 Web 服务。 Web 服务将接收对象列表并处理它们。我将使用以下操作作为示例。
public class AddToDatabaseService{
public void addToDatabase(String name1, String name2, String name3, ....)
{
//add names to database
}
}
我希望 Web 服务的调用者使用如下 URI: http://localhost:8080/axis2 /services/addToDatabase?name1=Joe&name2=Bob&name3=Kelly&name4=...
我知道这不是可编译的代码,但这个想法仍然存在。这对于基于 SOAP 的 Web 服务是否可行?我知道这可以通过 RESTful 服务来实现,因为您只需获取 HttpServletRequest 请求对象并执行 Enumeration enumeration = request.getParameterNames() 并迭代它们即可。
我正在寻找 Axis2 的 Web 服务 POJO 中的等效项。 一个链接或示例程序就太好了!
谢谢。
I have a web service that I built with Axis2/Java. The web service will take in a list of objects and will process them. I'll use the following operation as an example.
public class AddToDatabaseService{
public void addToDatabase(String name1, String name2, String name3, ....)
{
//add names to database
}
}
I want the caller of my web service to use a URI like:
http://localhost:8080/axis2/services/addToDatabase?name1=Joe&name2=Bob&name3=Kelly&name4=...
I'm aware this is not compilable code and the idea is still there. Is this even possible with SOAP-based web services? I know this is possible to do with RESTful services because you can just take the HttpServletRequest request object and do Enumeration enumeration = request.getParameterNames() and iterate through them.
I'm looking for the equivalent of that in web services POJO's with Axis2.
A link or an sample program would be great!
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与此问题类似,
解决方案是使用varargs 参数
Similar to the this question
Solution was to use a varargs parameter