【问题标题】:How to return SOAPFault to the client from the Filter?如何从过滤器向客户端返回 SOAPFault?
【发布时间】:2010-12-29 13:34:53
【问题描述】:

我有下面的代码,我需要返回 SOAP 响应(正确的 XML)。如果我throw new SoapException(...),它将返回错误的 HTML 页面。提前感谢所有建议。

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

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

...
}

【问题讨论】:

    标签: java web-services servlets soap servlet-filters


    【解决方案1】:

    SOAPException 不能在 Filter 中创建。我必须抛出SerlvetException。如果我想返回SOAPException,我必须链接CXF servlet并把它扔在那里。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-09
      • 2015-11-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多