File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes How to define a list of objects in XSD for a JAX-B webservice project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to define a list of objects in XSD for a JAX-B webservice project" Watch "How to define a list of objects in XSD for a JAX-B webservice project" New topic
Author

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

Nikhil Nagrani
Greenhorn

Joined: Dec 23, 2010
Posts: 24
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to define a list of objects in XSD for a JAX-B webservice project
 
Similar Threads
converting xsd to html
XmlException on calling WSDL2Java
MS Exchange web service: If the 'nillable' attribute is false in the schema, the 'xsi:nil' attribute
java.lang.InstantiationException - When try to call a web service
REST client with POST verb - some help needed