Variable number of arguments in an Axis2 POJO

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-14T04:02:23Z Indexed on 2010/03/14 4:05 UTC
Read the original article Hit count: 929

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about web-services