You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Brady Johnson (JIRA)" <tu...@ws.apache.org> on 2007/11/07 22:12:50 UTC

[jira] Created: (TUSCANY-1900) xsd:element maxOccurs attribute not working correctly

xsd:element maxOccurs attribute not working correctly
-----------------------------------------------------

                 Key: TUSCANY-1900
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1900
             Project: Tuscany
          Issue Type: Bug
          Components: C++ SDO
    Affects Versions: Cpp-M4
         Environment: All platforms
            Reporter: Brady Johnson
             Fix For: Cpp-M4


While creating unit tests for the TuscanySCA WSDL parser, I noticed that the maxOccurs 
attribute for the xsd:element is not working correctly. This can be reproduced looking at 
the TuscanySCA WSDL schema: wsdl_11.xsd snippet for the binding/operatin/input element:

  <xs:complexType name="tBindingOperation">
    <xs:complexContent>
      <xs:extension base="wsdl:tExtensibleDocumented">
        <xs:sequence>
          <xs:element name="input" type="wsdl:tBindingOperationMessage" minOccurs="0"/>     <!-- LOOK HERE -->
          <xs:element name="output" type="wsdl:tBindingOperationMessage" minOccurs="0"/>
          <xs:element name="fault" type="wsdl:tBindingOperationFault" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:NCName" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

If maxOccurs is not present it should default to 1. I tried adding maxOccurs="1" and loaded a WSDL with
the following (Notice there are 2 <input/> elements in the operation):

  <binding name="binding" type="tns:portType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="test">
      <soap:operation soapAction="http://www.tuscany.com/test/duplicate_services"/>
     <input>
        <soap:body use="literal"/>
      </input>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>

This XML loads with no errors. An exception should be thrown.

To reproduce this, comment out the following test in runtime/core/test/main.cpp

TEST ( wsdlErrorsTest.testDuplicateWSDLInputOutputBinding() );

--------------------
Brady Johnson
Lead Software Developer - HydraSCA
Rogue Wave Software - brady.johnson@roguewave.com


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org