
Originally Posted by
rwilcom
My question refers to the Spring WS endpoint definition in the application context file - where the 'targetClass' is set for the JibxMarshaller bean. We have tried to set this value to 'java.util.Collection' and the deployment fails - we have tried to set this value to 'java.util.ArrayList' and the deployment fails - so, how then, without writing a wrapper class of my own [that I map in JiBX] can I use the the generically supported types?
If I write a wrapper class such as 'CollectionMessage' then put the collection inside, then properly map 'CollectionMessage' in the jibx binding file all is well.
Within XML schema, there are only strongly-named collections. There is no such thing as a generic collection. For example, this doesn't exist:
Code:
<list>
<customer id="1"/>
<customer id="2"/>
</list>
You must always define your own parent element:
Code:
<customers>
<customer id="1"/>
<customer id="2"/>
</customers>
This means that you must always write such a Wrapper class. And this is actually a good thing, since the SOAP WS-I Basic Profile tells us to only add one child to a SOAP Body (i.e. the customers, and not all customer elements individually).

Originally Posted by
rwilcom
Also - what about types such as 'java.lang.Boolean'? If I write a JiBX serializer for such a type how do I reference the serializer?
Such a boolean value must always be contained in a element as well, e.g.
Code:
<returnValue>1</returnValue>
I'm not exactly sure how you would do that with Jibx, but I'm not expert. Perhaps the easiest way would be to use one of the non-marshalling endpoint classes, and write the result yourself.
There is a best practice here: try and focus on the XML you receive and respond with. I always try to create the XML first, to determine what it must look like, and then I map that to my classes. The XML is important; the classes (from a WS perspective) are not.

Originally Posted by
rwilcom
Also - what is your suggestion for methods that do not need to return anything? Such as a VOID return? Is that bad design since SOAP should always return something - such as at least 'true'/'false' [leads back to my Boolean question!]?
In SOAP lingo, this is known as a One Way operation. Basically, you don't any soap message. In the AbstractMarshallingPayloadEndpoint, you just return null, and no response will be created. You don't have to confirm every operation with something like a boolean, if anything goes wrong, you can respond with a fault.
Cheers,