开发者

How to return SOAPFault to the client from the Filter?

开发者 https://www.devze.com 2023-02-01 20:53 出处:网络
I have the code below and I need to return SOAP response (correct XML). If I throw new SoapException(...), it will return HTML page which is wrong. Thanks in a开发者_如何学Godvance for all advises.

I have the code below and I need to return SOAP response (correct XML). If I throw new SoapException(...), it will return HTML page which is wrong. Thanks in a开发者_如何学Godvance for all advises.

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
...

    if (!checkMsg()) {
        // return SOAP response
    }

...
}


The SOAPException cannot be created in the Filter. I have to throw SerlvetException. If I want to return the SOAPException, I have to chain CXF servlet and throw it there.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号