This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

How to implement WS-BaseFaults

Apr 21st, 2008, 04:53 PM

Hello,

I'm playing around with writing a simple WS-Notification framework using Spring-WS, and I'm unclear on how to implement WS-Basefaults.

I have the necessary classes to marshall/unmarshall a base fault, I'm just not sure how to wire them up using Spring-WS. As far as I can tell what I want to do is to extend AbstractSoapFaultDefinitionExceptionResolver and override customizeFault in order to make the SoapFault's detail compliant with WS-BaseFaults.

This is where I get stuck. Based on another posting I read here Arjen specifically added SoapFaultDetail.getResult in order to do such a thing, but I'm not sure how to implement this. Is the answer as simple as writing my own ExceptionResolver with the appropriate marshaller wired in and then added my own SoapFaultDetail uses that marshaller to spit out the desired xml? Or should I go about this some other way?

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:

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?