[jboss-user] [JBossWS] - Re: 1.0.2: Exception when client receives a JavaBean

anatoly.osiko do-not-reply at jboss.com
Thu Jul 27 20:37:53 EDT 2006

I have found this feature of JBossWS empirically as well, whatever worked with the Axis based ws4jee stopped working .... JBossWS appears to be strictly adheres to XML Schema definitions. Which is good. The  by definition defines not only the elements it contains, but also their order (compare with ). Therefore the missing element in the message raises the error (on schema validation I guess), unless it explicitly defined with nillable="yes" attribute.
In the latter case, the element would be inserted in the message as 'nil' element, of course.

So the above is the solution. But not exactly.
There is a subtle case with the primitive types. If you expect the JavaBean to contain a primitive type, e.g. int, then - don't, if it's declared as nillable. The  primitive type element declared in the schema as nillable, will be generated as a Java object wrapper, e.g. Integer. As it should be. If your insist that property in JavaBean still be an int, then don't declare it nillable, but make sure it is always included in the resulting message.
Of course, the above doesn't effect xsd:string.

PS I wonder if there is a way to switch the schema validation off? May that will also increase the speed of JAXB processing.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961454#3961454

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961454

More information about the jboss-user mailing list