Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to define a list of objects in XSD for a JAX-B webservice project  RSS feed

Nikhil Nagrani
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Below are the files for my project:-


Requirement : Returning a list of promotion based on particular id.
Here in the above method toContract(), when i was returning a single Promotion object based on a id(not a primary key) on database,i was getting proper response in the soap ui.
But when tried to return list from the same method(based on a goiven criteria) and handled the same in requests-1-0.xsd(file given above) by giving

<xs:element name="promotion" type="beans:Promotion" minOccurs="0" maxOccurs="unbounded" />(handling list of Promotion bean object,previously gave maxOccurs="1")

i am getting the below error:-


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Compilation failure
[ERROR] /home/mobiliser/workspace/custom/services/endpoint/src/main/java/com/sybase365/mobiliser/custom/project/services/endpoint/[49,9] setPromotionList( in cannot be applied to (java.util.List)[ERROR]


Question : Does this auto-generated method setPromotion() bases on config defined in xsd takes single object as argumemt? If to define the list of objects within xsd
as defining maxoccurs="unbounded" for that object is not working?

Please provide inputs on the above query.Thanks.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!