我正在使用 CXF JAXWS 客户端从外部 Web 服务中检索一些信息。所以,基本上,我们有来自外部的 .xsd 和 .wsdl 文件,并尝试通过使用 cxf-codegen-plugin 生成客户端存根来实现我们的 ws 消费者。我们无法更改 .xsd 和 .wsdl 文件。一切正常,我们能够从外部服务发送和检索肥皂消息。但是,当我从日志中查看soap 请求消息时,我发现从我们的ws 客户端发送的soap(正文)消息中有很多未使用的命名空间。下面是一个例子
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:aheaderns="http://xxx.xxx.xxx.xxx/header.xsd">
<soap:Header>
...
</soap:Header>
<soap:Body>
<ns7:requestQuery xmlns:ns15="http://xxx.xxx.xxx.xxx/AAA" xmlns:ns14="http://xxx.xxx.xxx.xxx/BBB" xmlns:ns13="http://xxx.xxx.xxx.xxx/DDD" xmlns:ns12="http://xxx.xxx.xxx.xxx/CCC" xmlns:ns11="http://xxx.xxx.xxx.xxx/EEE" xmlns:ns10="http://xxx.xxx.xxx.xxx/FFF" xmlns:ns9="http://xxx.xxx.xxx.xxx/GGG" xmlns:ns8="http://xxx.xxx.xxx.xxx/HHH" xmlns:ns7="http://xxx.xxx.xxx.xxx/III" xmlns:ns6="http://xxx.xxx.xxx.xxx/JJJ" xmlns:ns5="http://xxx.xxx.xxx.xxx/KKK">
<ns7:sample>
<ns7:type>A</ns7:type>
<ns7:ref>1</ns7:ref>
</ns7:sample>
</ns7:requestQuery>
</soap:Body>
有没有办法从客户端发送的出站肥皂消息中删除未使用的命名空间?