WebSphere/WSAD problem: Passing array of objects in webservices


XML & Web services: WebSphere/WSAD problem: Passing array of objects in webservices

  1. Hi,

    I have an object array that I am passing to a WSAD 5.1.2 generated webservice. The java classes is generated from a provided WSDL file. The webservice test client in WSAD allows me to test for such cases and gives me an easy Add/Remove button to add more objects to the array. However, only the last object I enter in the array shows up in the debug view when the client call reaches the webservice.

    I have tested the webservice with XML Spys function to generate SOAP Requests with the same result.

    My idea so far is that WSADs generation of java classes, the helper and (de)serialization classes, is erronous...

    Has anybody else had this problem ? Can anyone show me the way around this ?
  2. Every pair of array getter/setter on the server-side TOs objects need to have additionnal indexed getters /setters, i.e. :

    public class SampleValue {
    private ChildValue[] values = null;

    public ChildValue[] getValues () {

    public ChildValue getValues (int i) {

    public void setValues (int i, ChildValue value) {

    public void setValues (ChildValue[] value) {

    I think this trick should work.

    This is a know bug in WAS 5.x.
  3. Thank you Mr. Gonzalez Adrian . Your Trick really works. Is it possible for you to provide a link to the IBM's website which tells about this bug.