wood burning stoves 2.0*
The moose likes Web Services and the fly likes How to make Axis2 bottom-up webservice make minOccurs= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to make Axis2 bottom-up webservice make minOccurs="1" nillable="false"" Watch "How to make Axis2 bottom-up webservice make minOccurs="1" nillable="false"" New topic
Author

How to make Axis2 bottom-up webservice make minOccurs="1" nillable="false"

Xolani Nkosi
Ranch Hand

Joined: Apr 29, 2009
Posts: 32
I'm generating a bottom-up Axis2 webservice in Eclipse. However, once deployed, every element in my WSDL looks like:

for the corresponding javabean:

I thought applying an @XmlElement annotation was the way to go to change this in the emitted xsd, but evidently not.

So how to make Axis2 generate an XSD with anything other than minOccurs="0" nillable="true"? Please don't suggest I change the Integer to an int, as this is obviously not going to work for Strings, which I also need to mark as minOccurs="1" nillable="false"
Arun Kumar
Ranch Hand

Joined: Oct 10, 2007
Posts: 30
Xolan, did you get this to work? I have same issue with Axis2.
Xolani Nkosi
Ranch Hand

Joined: Apr 29, 2009
Posts: 32
cat MyService.wsdl | sed 's/minOccurs="0"/minOccurs="1"/g' | sed 's/nillable="true"/nillable="false"/g' >MyServiceFixed.wsdl

In other words, no, as it was wasting more time trying to work out why Axis2 doesn't work that it was to just fix the wsdl with a find/replace. I did notice that Eclipse only offers ADB or XMLBEANS databindings, whereas @XmlElement is a JAXB annotation, but then the (virtually nonexistant and unhelpful) documentation on ADB says it's supposed to support JSR222 annotations, which it clearly doesn't, at which point I lost the will to keep digging. Why nothing in Java enterprise is ever simple or easy god only knows.
Hikari Shidou
Ranch Hand

Joined: Jan 22, 2013
Posts: 88
Anybody had more luck about it? That's exactally what I was gonna ask
francis varkey
Ranch Hand

Joined: Sep 13, 2005
Posts: 169
I am having the same issue in JAX-WS and apache cxf bottom-up web service . Any suggestions will be a big help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make Axis2 bottom-up webservice make minOccurs="1" nillable="false"