我有以下拦截器来修改soap响应的标头。我也想清除肥皂响应的主体,但我找不到任何关于这样做或解决它的方法的文档。建议?
public class LisResponseInterceptor extends EndpointInterceptorAdapter {
@Override
public boolean handleResponse(MessageContext messageContext, Object endpoint) {
return true;
}
@Override
public boolean handleRequest(MessageContext messageContext, Object endpoint) {
return true;
}
@Override
public boolean handleFault(MessageContext messageContext, Object endpoint) {
SoapMessage response = (SoapMessage) messageContext.getResponse();
SoapHeader header = response.getSoapHeader();
header.addHeaderElement(new QName("ims","imsx_syncRequestHeaderInfo"));
SoapBody body = response.getSoapBody();
// clear body
return true;
}
}