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

'RuntimeException: Unexpected subelement' when wsdl adds a new property

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.7.0
    • Component/s: codegen
    • Labels:
      None
    • Environment:
      Win2k3, Java 6.0, Axis2 1.2

      Description

      I have an client app that was created and had been working, it makes a call to one webservice.
      The webservice was upgraded, it added some new methods and it also added a new property (Type) to one of the return types I was using.
      Now my app will no longer work, i get a runtime error, java.lang.RuntimeException: Unexpected subelement Type, when the results are returned to my service.
      If i rebuilt the client stub code using wsdl2java with the new wsdl my app will work again.

      As I understand it, adding fields to a object should not break any existing code. Any Xml elements returned that are not known elements should be ignored and not cause exceptions in the client code.
      I have tested my assumption with Visual Studio 2005, if i genereate web service client code using the old wsdl I can still call the new service without an exception being thrown because of the new Xml element being returned.

      Is there some option that I don't know of that will allow for new elements to be returned without exceptions being throw?

      1. TestRunner.java
        1 kB
        Chris B
      2. iu.patch
        13 kB
        Vincent Greene
      3. futures_old.wsdl
        227 kB
        Chris B
      4. futures_new.wsdl
        243 kB
        Chris B

        Issue Links

          Activity

          Hide
          sagara Sagara Gunathunga added a comment -

          Fixed with AXIS2-4859.

          Show
          sagara Sagara Gunathunga added a comment - Fixed with AXIS2-4859 .
          Hide
          anishpyne Anish Pyne added a comment -

          Can we please have this patch available in Axis2 release at the earliest.

          Show
          anishpyne Anish Pyne added a comment - Can we please have this patch available in Axis2 release at the earliest.
          Hide
          mccloud35 Tharindu Mathew added a comment -

          There are patches for this issue. Please verify and resolve.

          Show
          mccloud35 Tharindu Mathew added a comment - There are patches for this issue. Please verify and resolve.
          Hide
          deanholdren Dean Holdren added a comment -

          I've created an updated patch for current trunk (and also one for 1_5 branch).
          I made a new JIRA issue, since this one is a little old. My patch is based on this one, but handles more cases, and will process the remaining response elements

          https://issues.apache.org/jira/browse/AXIS2-4859

          Show
          deanholdren Dean Holdren added a comment - I've created an updated patch for current trunk (and also one for 1_5 branch). I made a new JIRA issue, since this one is a little old. My patch is based on this one, but handles more cases, and will process the remaining response elements https://issues.apache.org/jira/browse/AXIS2-4859
          Hide
          amilachinthaka Amila Chinthaka Suriarachchi added a comment -

          sorry for not committing your patch.

          will you be able to resend this with current axis2 trunk. Have you checked whether it is compatible with that?

          Show
          amilachinthaka Amila Chinthaka Suriarachchi added a comment - sorry for not committing your patch. will you be able to resend this with current axis2 trunk. Have you checked whether it is compatible with that?
          Hide
          vgreene Vincent Greene added a comment -

          As far as I know, my patch has not been committed to the base code, so there
          is no binary with the fix. The problem is assigned to Amila Chinthaka
          Suriarachchi<https://issues.apache.org/jira/secure/ViewProfile.jspa?name=amilachinthaka>,
          but there has been no response to my posts to the bug, or my patch.

          If you need the function provided by the patch, you can get the source and
          apply the patch, then use it to do your code generation. This is a patch to
          the generation of the code, so once you build the code with that version,
          you can use the base binaries at runtime.

          On Mon, Mar 1, 2010 at 12:56 AM, Satish Tottempudi (JIRA)

          Show
          vgreene Vincent Greene added a comment - As far as I know, my patch has not been committed to the base code, so there is no binary with the fix. The problem is assigned to Amila Chinthaka Suriarachchi< https://issues.apache.org/jira/secure/ViewProfile.jspa?name=amilachinthaka >, but there has been no response to my posts to the bug, or my patch. If you need the function provided by the patch, you can get the source and apply the patch, then use it to do your code generation. This is a patch to the generation of the code, so once you build the code with that version, you can use the base binaries at runtime. On Mon, Mar 1, 2010 at 12:56 AM, Satish Tottempudi (JIRA)
          Hide
          vgreene Vincent Greene added a comment -

          The patch (iu.patch) is attached to the problem. If you apply that
          patch to the latest source, the feature will be added. I am not a
          committer on the project, so I cannot comment on when (or if) it will
          become part of the base Axis2

          Show
          vgreene Vincent Greene added a comment - The patch (iu.patch) is attached to the problem. If you apply that patch to the latest source, the feature will be added. I am not a committer on the project, so I cannot comment on when (or if) it will become part of the base Axis2
          Hide
          fellowdeveloper Lien Tran added a comment -

          Hello, do you know when this patch will be available?

          Show
          fellowdeveloper Lien Tran added a comment - Hello, do you know when this patch will be available?
          Hide
          vgreene Vincent Greene added a comment -

          Attached a patch to add this as a feature during code generation using wsdl2java.

          Show
          vgreene Vincent Greene added a comment - Attached a patch to add this as a feature during code generation using wsdl2java.
          Hide
          vgreene Vincent Greene added a comment -

          Patch to add -Eiu option to wsdl2java so code generation will ignore and log warning instead of an exception when an unexpected element is found while parsing response. This defaults to current behavior and adds this as a feature for code generation.

          Show
          vgreene Vincent Greene added a comment - Patch to add -Eiu option to wsdl2java so code generation will ignore and log warning instead of an exception when an unexpected element is found while parsing response. This defaults to current behavior and adds this as a feature for code generation.
          Hide
          amilachinthaka Amila Chinthaka Suriarachchi added a comment -

          Well people can argue this as an bug and feature as well.
          I recently I added an option to off the strict valications. This is basically do not throw an exception when not receiving an expected element. So you are talking about the otherside.
          I'll put this too from the next release. but there won't be enough time for Axis2 1.3.

          Show
          amilachinthaka Amila Chinthaka Suriarachchi added a comment - Well people can argue this as an bug and feature as well. I recently I added an option to off the strict valications. This is basically do not throw an exception when not receiving an expected element. So you are talking about the otherside. I'll put this too from the next release. but there won't be enough time for Axis2 1.3.
          Hide
          cbarbara Chris B added a comment -

          my sample TestRunner.java app that tests the operation that currently fails.

          If you really want to call the web service you can register for Xignite's web services for free to do testing, they have free trial accounts.

          Show
          cbarbara Chris B added a comment - my sample TestRunner.java app that tests the operation that currently fails. If you really want to call the web service you can register for Xignite's web services for free to do testing, they have free trial accounts.
          Hide
          cbarbara Chris B added a comment -

          the new current wsdl that contains a new field on the complexType Future.
          The new property name is Type, and it is an enumeration type named FutureTypes.

          This type can be returned by calling the GetDelayedFuture() operation.

          Show
          cbarbara Chris B added a comment - the new current wsdl that contains a new field on the complexType Future. The new property name is Type, and it is an enumeration type named FutureTypes. This type can be returned by calling the GetDelayedFuture() operation.
          Hide
          cbarbara Chris B added a comment -

          the old wsdl file

          Show
          cbarbara Chris B added a comment - the old wsdl file

            People

            • Assignee:
              amilachinthaka Amila Chinthaka Suriarachchi
              Reporter:
              cbarbara Chris B
            • Votes:
              6 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development