• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
============================================

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project com.sybase365.mobiliser.custom.project.services.endpoint: Compilation failure
[ERROR] /home/mobiliser/workspace/custom/services/endpoint/src/main/java/com/sybase365/mobiliser/custom/project/services/endpoint/PromotionEndpoint.java:[49,9] setPromotionList(com.sybase365.mobiliser.custom.project.services.contract.v1_0.beans.PromotionList) in com.sybase365.mobiliser.custom.project.services.contract.v1_0.GetPromotionResponseType 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 no..how 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic