Skip to Content
0
Former Member
Aug 29, 2007 at 03:37 PM

Portal WebService and Complex Parameter (Array) Response

25 Views

Hello Colleagues,

i use the function „Create WebService from Portal Service“ in the NWDS.

It Works fine for methods that take or give flat Parameters like this:

public String getValue(String value) {
return value;
}

But I need to use Complex structures. My first try was this method :

public String[] getArray(String value) {
String[] valueArray = new String[5];
for (int i = 0; i < valueArray.length; i++) {
      valueArray<i> = value;
      }
return valueArray;
}

This works too, but i only have unnamed parameters. Also there is no semantic in my parameters and i can not identify them (only by order). So i need to take a method like this:

public File[] getFiles(String value) {
File[] files = new File[5];
for (int i = 0; i < files.length; i++) {
    files<i>.setFilename("filename " + i);
    files<i>.setCreated(new Date(System.currentTimeMillis()));
    files<i>.setDescription("description " + i);
    files<i>.setLastModified(new Date(System.currentTimeMillis()));
    files<i>.setContent(new byte[20]);
}
return files;
}

I put the class "File" in the same package as the Service class. I also make a Interface to the File class.

When i deploy this to my Portal i get an "error_NoClassDefFoundError" in the soap response. What is the right way to make an webservice from a Portalservice with an complex parameter response?

Every hint is welcome.

Best regards,

Patrick

http://www.mindsquare.de