【发布时间】:2020-08-31 06:25:51
【问题描述】:
我有几个 xsd 文件用于创建一个 SOAP 消息的组合。 问题是,每当构建对象时,它都会导入所有继承的 xmlns。我没有发现任何关于这个问题的信息。有没有办法只留下root xmlns?
例子:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<testRes xmlns="http://xxx/xxx/xxx/v1" xmlns:ns2="http://yyy/yyy/yyy/v1" xmlns:ns3="http://zzz/zzz/zzz/v1">
<status>B</status>
<opisBledu>Error msg...</opisBledu>
</testRes>
</S:Body>
</S:Envelope>
我需要的信息是:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<testRes xmlns="http://xxx/xxx/xxx/v1"
<status>B</status>
<opisBledu>Error msg...</opisBledu>
</testRes>
</S:Body>
</S:Envelope>
有需要 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 来自 S:Envelope 并且 xmlns:ns2="http://yyy/yyy/yyy/v1" xmlns:ns3="http://zzz/zzz/zzz/v1" 来自 testRes 必须被删除。 有什么方法可以实现吗?
【问题讨论】: