I have the following method and want to avoid having to explicitly show the JAXBElement<> syntax. Is there some sort of annotation that would allow the method to appear to accept raw MessageResponse objects but in actuality work the same as shown below? I'm not sure how clear that was so I'll say this: I'm looking for some syntactic sugar :)
@ServiceActivator
public void handleMessageResponse(JAXBElement<MessageResponse> jaxbResponse) {
MessageResponse response = jaxbResponse.getValue();
MessageStatus status = messageStatusDao.getByStoreIdAndMessageId(re开发者_如何学JAVAsponse.getStoreId(), response.getMessageId());
status.setStatusTimestamp(response.getDate());
status.setStatus("Complete");
}
You can use the unmarshalling transformer described in the reference guide here.
Adapted from the documentation (usable in a chain):
<si-xml:unmarshalling-transformer unmarshaller="unmarshaller" />
This should give you a domain object as the message payload.
精彩评论