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

minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.7.0, nightly
    • Tools
    • None

    Description

      When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:

      public Integer a(String, Integer)
      public String b(Integer, String)

      Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters.

      When generating clients using .NET WebService Studio 2.0, the result is the following:

      • all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
      • all the generated C# methods return parameters are void, except for the string ones

      The actual result are clients with methods like these:

      public void a(string, int, bool);
      public string b(int, bool, string);

      This is obviously a problem, particularly for the "void" return type.

      If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.

      The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

      Attachments

        1. axis2-1.4.1.diff
          0.5 kB
          Chris van Es

        Issue Links

          Activity

            People

              deepal Deepal Jayasinghe
              mauromol Mauro Molinari
              Votes:
              8 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: