Good day,

Is there anyway to capture a SOAP request that causes a Unmarshall
Exception?  I created a fault interceptor that fires off when the exception
occurs, but I have not been able to figure out how to capture the actual
request so I can store it on the file system.  I have tried various parent
interceptors and various phases, but I only get partial request at best

Here is my attempt:
p/ublic class MyFaultInterceptor extends AbstractSoapInterceptor { 

public MyFaultInterceptor() {
        super(Phase.POST_PROTOCOL);  // MARSHAL seems more promising?
    }

@Override
    public void handleMessage(SoapMessage message) throws Fault {

        if (message instanceof SoapMessage) {
            LOGGER.error("MyFaultInterceptor Invoked ");
            try {
                Exchange exchange = message.getExchange();
                if (exchange != null) {
                    SoapMessage exMessage = (SoapMessage)
exchange.getInMessage();
                    InputStream inmessage =
exMessage.getContent(InputStream.class);
                    String payload =
MyRestUtilities.extractStringFromPayload(inmessage);

                    savePayloadToFile(payload);
                }
            } catch (Exception e) {
                LOGGER.error(e.getMessage());
            }
        }
    }/

And here is how I invoke it:
/<cxf:jaxws-service serviceClass="my.WebService" validationEnabled="false">
   
        <cxf:outFaultInterceptors>
                <spring:bean id="faultInterceptor" class="MyFaultInterceptor"/> 
                                
        </cxf:outFaultInterceptors>
</cxf:jaxws-service>/

This has been driving me nuts and I have not found a way to extract the
actual request (headers optional) into a string so I can write to a file.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Interceptor-capture-of-SOAP-request-tp5710324.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to