I am just getting started with Spring-WS. My ititial EndPoint implementation subclassed AbstractDomPayloadEndpoint and manually handled the Marshalling/Unmarshalling. I now want to try it by subclassing AbstractMarshallingPayloadEndpoint and use Castor as my XML marshalling framework.
My first pass was to simply declare a CastorMarshaller bean with no mapping file and use this my end point's marshaller and unmarshaller. I did not expect this to work - I just wanted to see what happened. Naturally, I got an exception:
org.springframework.oxm.castor.CastorUnmarshalling FailureException: Castor unmarshalling exception: The class for the root element 'GetCalendarDayRequest' could not be found.; nested exception is The class for the root element 'GetCalendarDayRequest' could not be found.
Fine - I have not mapped this class yet, so Castor does not no how to handle this. But this brings up a question I have regarding the typical Spring-WS method for mapping messages. In my case, my schema (simple at this point) looks like this:
<element name="Date" type="date" />
<element name="CalendarDay" type="tns:CalendarDay"/>
<element name="Date" type="date"/>
<element name="Type" type="string"/>
<element name="WorkDay" type="boolean"/>
<element name="LastWorkDayOfTheMonth" type="boolean"/>
As you can see, I have a declaration for my request, response and a complex type with my response. So the top level element of my incoming request message is a <GetCalendarDayRequest>. However, I don't want to map *this* to an object, only the contents. The same goes for the response. In other words, These elements exist only to wrap the contents of the SOAP messages. I would prefer to not inroduce these as real objects.
In the sample Castor mappings that come with Spring-WS, there are mapping for the flights and flight elements, but none for the GetFlightsRequest and GetFlightsResponse elements that are in the airline.xsd schema file in the Airline example.
So, to sum up this rambling, is it necessary to map request and response "wrapper" elements, or is there a way to bypass these elements and go straight to the sub-elements, were the domain-specific elements are located.