Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-876

xsd:choice with nested xsd:sequence generates code as though xsd:sequence with nested xsd:choice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • None
    • current (nightly)
    • Serialization
    • None

    Description

      Hi,

      I've defined a complex type as

      <xsd:complexType name="aRecord">
      <xsd:choice>
      <xsd:sequence>
      <xsd:element name="field1" type="xsd:string" minOccurs="0" nillable="false"/>
      <xsd:element name="field2" type="xsd:string" minOccurs="0" nillable="false"/>
      </xsd:sequence>
      <xsd:element name="field3" type="xsd:string" nillable="false"/>
      <xsd:element name="field4" type="xsd:string" nillable="false"/>
      </xsd:choice>
      </xsd:complexType>

      and trying to send aRecord object as part of request message and receive the same in return.

      Here is the serialize code generated for the above choice object:

      /* then serialize elements if any*/
      pSZ->serializeAsElement("field1", Axis_URI_aRecord, (void*)(param->field1), XSD_STRING);
      pSZ->serializeAsElement("field2", Axis_URI_aRecord, (void*)(param->field2), XSD_STRING);
      if(param->field3)

      { pSZ->serializeAsElement("field3", Axis_URI_aRecord, (void*)(param->field3), XSD_STRING); }

      else if(param->field4)

      { pSZ->serializeAsElement("field4", Axis_URI_aRecord, (void*)(param->field4), XSD_STRING); }

      From this it appears that, it's acted as though we have a choice within a sequence, rather than a sequence within a choice.

      Regards
      Manohar

      Attachments

        1. ComplexTypeChoiceNestedSequence.wsdl
          4 kB
          Manohar Kumar Chintala

        Activity

          People

            Unassigned Unassigned
            cmanohar Manohar Kumar Chintala
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: