The solution to this problem was tied up in JSR101 mapping rules.  I needed
a properly formed setStreetAddress(StreetAddress[] addresses) method in my
java object to be fully compliant with the JavaBeans spec.

Hope this helps someone out.

Kory Lasker

-----Original Message-----
From: Lasker, Kory 
Sent: Monday, October 21, 2002 6:41 PM
To: '[EMAIL PROTECTED]'
Subject: Arrays of Objects in a complexType



I've got a complex object (it's just a bunch of StreetAddress inside a
StreetAddresses container) that's returned from a web service (see object
below --it's small).  I've registered this object in the WSDD like this:

<beanMapping
  xmlns:ns="http://myurl.com";
  qname="ns:StreetAddress"
  languageSpecificType="java:com.mycompany.StreetAddress"/>

<beanMapping
  xmlns:ns="http://myurl.com";
  qname="ns:StreetAddresses"
  languageSpecificType="java:com.mycompany.StreetAddresses"/>

  However, once I deploy the web service and go to the WSDL, it doesn't
realize the StreetAddresses object should contain an entry with an unbounded
sequence of StreetAddress objects.  Instead, it just shows the State and Zip
fields.  I really can't figure out what's going on.  I've got a nearly
identical object elsewhere that works perfectly, yet I can't find much
difference between them.

  Any ideas out there?

  Thanks,

  Kory Lasker

--- CODE FRAGMENT (SEE ABOVE) --

  public class StreetAddresses {
    private String state;
    private String zip;
    private ArrayList addresses;

    public StreetAddresses() {
      super();
      addresses = new ArrayList();
    }

    public String getState() {
      return this.state;
    }

    public String getZip() {
      return this.zip;
    }

    public StreetAddress[] getStreetAddress() {
       return (StreetAddress[]) addresses.toArray(new StreetAddress[0]);
    }
  }

Reply via email to