Arjen,
Thanks for your response. I think I've got it now (roughly):
Code:
SoapFault fault = soapBody.addFault();
SoapFaultDetail detail = fault.addFaultDetail();
marshaller.marshall(myJaxBGraph, detail.getResult());
I *think* this works but I ran into another problem. Namely that I am using WS-Addressing via a AnnotationActionEndpointMapping endpoint mapper. AnnotationActionEndpointMapping is an ancestor of AbstractAddressingEndpointMapping, which as you know adds an implicit AddressingEndpointInterceptor in between it's pre and post interceptors.
My response with the WS-BaseFault detail doesn't get set because the AddressingEndpointInterceptor attempts to set the Action SOAP header variable to a default 'faultAction' in the case of a fault:
Code:
SoapMessage reply = (SoapMessage) messageContext.getResponse();
URI replyMessageId = getMessageId(reply);
URI action = !isFault ? replyAction : faultAction;
MessageAddressingProperties replyMap = requestMap.getReplyProperties(replyEpr, action, replyMessageId);
version.addAddressingHeaders(reply, replyMap);
'faultAction' is always null, and it appears that AbstractAddressingEndpointMapping doesn't expose it either:
Code:
AddressingEndpointInterceptor interceptor =
new AddressingEndpointInterceptor(version, messageIdStrategy, messageSenders, responseAction, null);
I suppose I could add my own post interceptor and reset the addressing header (or at least the action portion), but it seems so ugly. Would it be possible to expose a default 'faultAction' to be taken in AbstractAddressingEndpointMapping?
Thanks!