[jboss-user] [JBossWS] - How to avoid optional parameters (wsgen)
awhitford
do-not-reply at jboss.com
Sat Nov 22 20:56:54 EST 2008
Consider a simple web service method:
| @WebMethod
| void foo (@WebParam(name="param") String param)
|
When generating the WSDL using wsgen, and inspecting it in SoapUI, I notice that a primitive type (like an int) won't appear as optional, but an object reference does. In some cases, I would like to declare the parameter as required. I thought I could do something like:
| @WebMethod
| void foo (@WebParam(name="param") @XmlElement(nillable=false, required=true) String param)
|
Alas, this doesn't even compile because I can't use XmlElement for a method parameter...
I'm pretty sure that the optional interpretation is coming from the minOccurs="0" attribute on the xs:element.
Is there a way that I can control this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191518#4191518
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191518
More information about the jboss-user
mailing list