-
1. Re: Question about webservice returning array with nillable=
ropalka Nov 21, 2007 3:21 AM (in response to fheldt)Hi,
let JBossWS generate your WSDL first. Then copy it somewhere and modify its schema. Then update your Webservice java code (using appropriate annotation) to use your modified WSDL file instead of generated one.
Richard -
2. Re: Question about webservice returning array with nillable=
asoldano Nov 21, 2007 3:30 PM (in response to fheldt)In particular I guess you get non-nillable elements using an array of primitive int instead of an array of Integer.
However generally speaking, what Richard suggest you is the best solution whenever you need to force some constraints on the service contract (see the top-down approach in the documentation). -
3. Re: Question about webservice returning array with nillable=
fheldt Nov 28, 2007 11:34 AM (in response to fheldt)I changed the wsdl by hand and it works now, but i also investigated this topic a little further. No matter what i change the return type to, JBossWS always generates the same result (and that's a bug imho):
@WebMethod public Integer[] GetSteps(String ugid) { ... } or @WebMethod public int[] GetSteps(String ugid) { ... }
give both... <xs:schema targetNamespace="http://jaxb.dev.java.net/array" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType final="#all" name="intArray"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="xs:int"/> </xs:sequence> </xs:complexType> </xs:schema> ... <message name="QMWebService_GetStepsResponse"> <part name="return" type="ns1:intArray"> </part> </message>
in the int[] case i would suppose nillable="false", else nillable="true", right? -
4. Re: Question about webservice returning array with nillable=
ropalka Nov 28, 2007 11:56 AM (in response to fheldt)Hi,
yes, you're right:
http://jira.jboss.org/jira/browse/JBWS-1915
Richard -
5. Re: Question about webservice returning array with nillable=
ropalka Jan 3, 2008 5:36 AM (in response to fheldt)This is the JAXB related issue.
http://jbws.dyndns.org/mediawiki/index.php?title=FAQ#Customizing_WSDL_Schema_Generation