4

当发出 SOAP 请求并且验证失败时,我得到的响应是:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client</faultcode>
         <faultstring xml:lang="en">Validation error</faultstring>
         <detail>
            <spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">xyz-pattern-valid: Value '.....' is not facet-valid with respect to pattern '[0-9x]+' for type 'ABC'.</spring-ws:ValidationError>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

有没有办法摆脱无处不在的 spring-ws ,这显然暴露了底层 SOAP 服务正在使用 Spring 和 Java?

我已经查看了扩展 PayloadValidatingInterceptor,但看不到明显的方法来摆脱 spring-ws 标签。

4

1 回答 1

5

弄清楚了

public class ValidatingInterceptor extends PayloadValidatingInterceptor {
    @Override
    public QName getDetailElementName() {
        return new QName("http://www.mycee.co.za", "tech", "mt");
    }
}

哇!

于 2013-07-12T09:49:47.860 回答