membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
94 stars 73 forks source link

RequestCreator: elements of type ref don't handle attributes #204

Closed Falcom1234 closed 10 years ago

Falcom1234 commented 10 years ago

This one was tricky to find :-)

If you use an element with a reference and set minOccurs to 0, this attribute is parsed correctly and then ignored for the creation of the actucal element.

This happens in com.predic8.wstool.creator.RequestCreator on line 48:

element.schema.getElement(element.ref).create(this,ctx.clone(element))

Here only the element.ref is used to get the new element and all attributes are ignored.

XML-Example:

<element ref="GERROR:Error" minOccurs="0">

Same problem is in RequestTemplateCreator

keshavarzi commented 10 years ago

Thank you for this report. But I don't really know what are you missing! RequtstTemplateCreator would add a comment also for elements with a reference if the element is optional or can be repeated etc. How would you integrate the minOccurs attribute in to the generated xml?

keshavarzi commented 10 years ago

minOccurs is used in RequestTemplateCreator to add a comment. See: RequestTemplateCreator: 44