Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Webservice - compley type and array

Webservice - compley type and array

Webservice - compley type and array

I'm trying to make a webservice that returns an array of objects, which contains another array of objects.

Everything works fine, when I hack the wsdl manually.
How can I make it work automatically?

I'm using Eclipse 3.4 for Java EE, Axis 1.4, Glassfish v2 UR2, and Eclipse's Web Services Explorer for testing.

My service method looks like this:
    public DataSet[] getDataSet(User owner) {
        DataSet[] res = new DataSet[2];
        res[0] = new DataSet();
        DataSet ds = res[0];
        ds.setDescription("No desc");
        String[] ss = {"One", "Two"};
        return res;
DataSet is a simple JavaBean:

public class DataSet implements java.io.Serializable {
    private String name;
    private String description;
    private boolean isDefault;
    private String[] columns;
    public String getName() {
        return name;
    public void setName(String name) {
        this.name = name;
    public String getDescription() {
        return description;
    public void setDescription(String description) {
        this.description = description;
    public boolean getIsDefault() {
        return isDefault;
    public void setIsDefault(boolean isDefault) {
        this.isDefault = isDefault;
    public String[] getColumns() {
        return columns;
    public void setColumns(String[] columns) {
        this.columns = columns;


Generated WSDL:
   <element name="getDataSetResponse">
      <element maxOccurs="unbounded" name="getDataSetReturn" type="impl:DataSet"/>
   <complexType name="ArrayOf_xsd_string">
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:string"/>
   <complexType name="DataSet">
     <element name="columns" nillable="true" type="impl:ArrayOf_xsd_string"/>
     <element name="description" nillable="true" type="xsd:string"/>
     <element name="isDefault" type="xsd:boolean"/>
     <element name="name" nillable="true" type="xsd:string"/>

It works when I set the name of the element of "ArrayOf_xsd_string" to "columns".   (<element maxOccurs="unbounded" minOccurs="0" name="columns" type="xsd:string"/>)

SOAP response:
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <getDataSetResponse xmlns="http://score.com">
- <getDataSetReturn>
- <columns>
  <description>No desc</description>
  <getDataSetReturn xsi:nil="true" />

Any idea?

RE: Webservice - compley type and array

Why do you say the other option is wrong? I think it's being generated OK.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close