Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-2706

ADB client doesn't receive 0-length array of beans

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • None
    • adb
    • None
    • XP, Java 1.4.2_13, Tomcat 5.0.28

    Description

      A service returns an array of JavaBeans that is of length 0.

      The client gets an exception "Unexpected subelement"

      This may be related to bugs 2464 and 1702

      To provide some clarity, I will attach a version of sample/addressbook. I've made the following changes:

      (1) In the service, I've added methods to return arrays of Entry:

      public Entry[] getEntries1() {
      return new Entry[]

      { createEntry(), createEntry() }

      ;
      }

      public Entry[] getEntries2()

      { return new Entry[0]; }

      (2) Then I exercise both methods in the client as follows (the call to getEntries2 fails):

      GetEntries1Response e1Response = stub.getEntries1();
      Entry[] entries1 = e1Response.get_return();
      System.out.println("Number of items returned by getEntries1(): " + entries1.length);

      GetEntries2Response e2Response = stub.getEntries2();
      Entry[] entries2 = e2Response.get_return();
      System.out.println("Number of items returned by getEntries2(): " + entries2.length);

      I did it this way so that the fact that an array of length > 0 is obvious.

      If I had time, I'd check with simple types, but in my case, a bean is the most important object type I need to return in an array.

      Idea:

      There seems to be a whole cluster of small issues around the POJO service + ADB client. E.g., methods that return void, exception handling, etc. A somewhat more robust version of sample/addressbook might bring these out. I'd be glad to beef up the example . . .

      I think the POJO service + ADB client is key for the Axis2 "product" because if the simplest entry point is awkward, people will just bag it and use other impls of the various APIs.

      Attachments

        1. pojo.jar
          329 kB
          John G. Norman
        2. pojo.jar
          293 kB
          John G. Norman

        Issue Links

          Activity

            People

              dims Davanum Srinivas
              xertroyt John G. Norman
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: