views:

74

answers:

0

Is there a way to automatically remove duplicate XML namespaces from messages generated by the WCF? It seems half of the message consists of duplicate namespaces.

Here is an example generated by WCF:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  <s:Header />
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http:
//www.w3.org/2001/XMLSchema">
    <ResourceCreated xmlns="http://schemas.xmlsoap.org/ws/2004/09/transfer"&gt;
      <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing"&gt;http://www.g
oogle.com/abcdef</wsa:Address>
      <p32:ResourceURI xmlns:p32="http://www.energiened.nl/Content/Publications/
dsmr/P32">http://www.energiened.nl/Content/Publications/dsmr/P32/meterAccess&lt;/p3
2:ResourceURI>
      <p32:SelectorSet xmlns:p32="http://www.energiened.nl/Content/Publications/
dsmr/P32">
        <p32:Selector p32:Name="ResourceID">MeterAccess-1</p32:Selector>
      </p32:SelectorSet>
    </ResourceCreated>
  </s:Body>
</s:Envelope>

What I would like it to be:

<s:Envelope 
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:wsa="http://www.w3.org/2005/08/addressing" 
xmlns="http://schemas.xmlsoap.org/ws/2004/09/transfer"
xmlns:p32="http://www.energiened.nl/Content/Publications/dsmr/P32"&gt;
  <s:Header />
  <s:Body>
    <ResourceCreated>
      <wsa:Address>http://www.google.com/abcdef&lt;/wsa:Address&gt;
      <p32:ResourceURI>http://www.energiened.nl/Content/Publications/dsmr/P32/meterAccess&lt;/p32:ResourceURI&gt;
      <p32:SelectorSet>
        <p32:Selector p32:Name="ResourceID">MeterAccess-1</p32:Selector>
      </p32:SelectorSet>
    </ResourceCreated>
  </s:Body>
</s:Envelope>