0 Replies Latest reply: Jan 20, 2009 1:36 PM by Gareth Ryan RSS

EJB Web Service returns a String array but it appears as an ArrayList?!

Gareth Ryan
Currently Being Moderated

Hi All,


I'm just messing around trying to get a proof of concept up and running and have a very simply EJB created with 1 business method.  The method is defined with no parameters and a return type of java.lang.String[] (an array of strings.)


So the Java method itself looks like this-


public String[] getIPAddresses() {
          ArrayList al = new ArrayList();
          al.add("First line");
          al.add("Second line");

          String[] ret = (String[]) al.toArray(new String[al.size()]);
          return ret;


At the moment I just have some test code to build an ArrayList of Strings but eventually it will be pulling some data from a JDBC connection.  I've read that VC cannot cope with models that return ArrayList objects hence I'm converting my ArrayList to a simple array of Strings.  This all appears fine.  I've then created a web service wrapper around this method and packaged it all up and deployed onto my J2EE system.


If I then use the Web Service Navigator on the system to test the web service it correctly runs and returns a response containing a String array with 3 entries as per the above code.


Now, I've launched VC 7.0 and defined a Web Service System for this web service.  I've then created a simple iView and added my new web service as a data service.  If I try to right-click and Test Data Service I can execute with no errors but I get no response back.  If I build, deploy and test the VC component properly I also get no response back.


Does anybody know what I'm doing wrong?!