-
1. Re: Array wrapping a MUST when using rpc/lit ?
fpitschi Jul 15, 2005 3:42 AM (in response to fpitschi)I think I found out by myself:
If you use (unwrapped!) String[], Object[], ... as parameters or return values in the ws-methods of your SEI, and use wscompile to generate the wsdl, the following happens: new complextypes ("StringArray", "NameofObjectArray") with special namespaces (e.g. "http://arrays/java/lang") are defined in the wsdl, and the corresponding messages use these types. In the generated jaxrpc-mapping.xml, these new namespaces are mapped to java-package-names (e.g. ._arrays.java.lang). These packages don't exist, and the wrapper classes (StringArray.java) also don't exist, their names were simply added to the wsdl - you get a warning when starting the server:
[JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://arrays/java/lang}StringArray
Now, it looks like if these "invented" array-wrappers can't be found at runtime, jboss takes the rpc/enc-style to (de)serialize the arrays. If you use jboss on server & client side: no problem, because both sides do the same and understand each other ;-) But the SOAP-message of course is not strict rpc/lit, because the arrays are rpc/enc.
Dirty solution: You can retrieve the wrappers by using wscompile. Then create the right packages / directory-structure looking at the wsdl & jaxrpc-mapping.xml for them. (I did not have insert type-mappings in the jaxrpc-mapping by hand to get everything running, but if you want to be on the safe side...).
Better solution: Right from the start, define a wrapper-class for every bare array you want to use, and use this wrapper class as input or return parameter instead of the original array.
Hoping not to cause too much confusion...
Florian Pitschi -
2. Re: Array wrapping a MUST when using rpc/lit ?
thomas.diesler Jul 22, 2005 1:47 PM (in response to fpitschi)When a wsdl message part references a type or element in schema it always points to a complex type that defines the array. Every complex type is always mapped to a java bean. So yes, you will have a wrapper.