Вопрос

When making a SOAP request and validation fails, the response I'm getting back is:

<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>

Is there a way to get rid of the spring-ws everywhere which is obviously exposing that the underlying SOAP service is using Spring and Java?

I've looked at extending PayloadValidatingInterceptor, but see no obvious way to get rid of the spring-ws tags.

Это было полезно?

Решение

Figured it out

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

WOOT!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top