3 Replies Latest reply on Apr 14, 2005 9:19 AM by thomas.diesler

    The soap response does not respect minOccurs=0 and sequence

    gag_72

      I've created a documentliteral webservice starting off from a wsdl and schema files. In two cases the SOAP response does not adher to Schema definitions.
      Lets say my schema looks like

      <xs:complexType name="EndpointConfigurationType">
       <xs:sequence>
      <xs:element name="BCAP" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="BANDWIDTH" type="xs:string" minOccurs="0" maxOccurs="1"/>
       <xs:element name="CAP" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CDPNTYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CGPNTYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CIDBLK" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="COMMENTS" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="CONTACT" type="xs:string" minOccurs="0" maxOccurs="1"/>
       </xs:sequence>

      </xs:complexType>

      With in my SoapResponse I get

      <endpointConfiguration>
       <BANDWIDTH xsi:nil="1"/>
       <BCAP xsi:nil="1"/>
       <CAP xsi:nil="1"/>
       <CDPNTYPE xsi:nil="1"/>
       <CGPNTYPE xsi:nil="1"/>
       <CIDBLK xsi:nil="1"/>
       <COMMENTS xsi:nil="1"/>
       <CONTACT xsi:nil="1"/>
       </endpointConfiguration>

      There are 2 problems with this response.
      1. Response is alphabetically sorted and does not respect sequence order.An axis bug, which I think has not been resolved. can somebody suugest a remedy other than suggesting I define schema alphabetically or use all instead of sequence. The reason is because I am inheriting from this schema and both of these remedy fail. Bug url at axis is
      http://issues.apache.org/jira/browse/AXIS-1524
      2. The element with xsi:nil should not be there at all, since they have been declared with minOccurs=0. this is due to another axis bug which has been resolved but I don't know if patch made it to ws4ee.jar.Is there any round about way for this?The issue at axis is
      http://issues.apache.org/jira/browse/AXIS-1357