gale320 / staff

Automatically exported from code.google.com/p/staff
Apache License 2.0
0 stars 0 forks source link

Mistake with codgen and maxOccurs=unbounded #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I generate, with codgen, the files (xxxxxWrapper.h , xxxxxWrapper.cpp) 
with the WSDL attached file , i have a mistake into xxxxWrapper.cpp

For the request 

      <!-- Response Add(std::string aid, const Configuration& configuration) -->
      <element name="AddConfigurationRequestElement">
        <complexType>
          <sequence>
            <element name="userID" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="configuration" type="ns:Configuration" minOccurs="1" maxOccurs="unbounded"/>
          </sequence>
        </complexType>
      </element>

codgen generate the following code :

    if (sOperationName == "AddConfigurationRequestElement")
    {
      rOperation.SetResponseName("AddConfigurationResultElement");
      std::list< ::Configuration > configuration;
      for (staff::DataObject tdoItem = rRequest.FirstChild(); !tdoItem.IsNull(); tdoItem.SetNextSibling())
      {
        if (tdoItem.GetLocalName() == "configuration")
        {
          (configuration).resize((configuration).size() + 1);
          tdoItem >> (configuration).back();
        }
      }

      const ::Response& tResult = tpServiceImpl->AddConfiguration(rRequest.GetChildTextByLocalName("configuration"), configuration);
      rOperation.Result() << tResult;
    }

the mistake comes from the method "GetChildTextByLocalName" with the parameter 
"configuration" instead of "userID"

if i change the maxOccurs parameter to 1, as following

            <element name="configuration" type="ns:Configuration" minOccurs="1" maxOccurs="1"/>

i don't have any problems,
there is a bug with the parameter unbounded ?

What version of the product are you using? On what operating system?

Staff (r776) - RedHat RHEL 6.2 x86_64

Original issue reported on code.google.com by laurent....@gmail.com on 25 Jun 2013 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like element name gets overwritten.

Original comment by loentar on 24 Jul 2013 at 8:00

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r782.

Original comment by loentar on 24 Jul 2013 at 8:08