Add prefix to XML Root Node - Implementation of Scott Hanselman's suggestion?

1.8k Views Asked by At

I would like to add a namespace prefix to the XML root node and I found an entry by Scott Hanselman which details exactly what I would like to achieve. The only problem being the implementation is missing !

Modifying the namespace PREFIX of the root node of the body of a SOAP Web Services Response....whew!

It would be of great help if I could get a few leads on how to go about this.

  1. Is there an implementation that already exists somewhere ?

  2. The entry by Scott was posted in 2003. Have things changed since then ? With .NET 3.5 around, are Soap Extensions still the right approach ?

EDIT: Current Web Service Response is something like ...

<response>
   <my-ns:name/>
</response>

desired response should look like ...

<my-ns:response>
   <my-ns:name/>
</my-ns:response>
1

There are 1 best solutions below

3
On BEST ANSWER

Seems like the issue with the missing namespace prefix for the root node exists only on .NET Framework 1.1 !

I migrated the code to .NET 3.5 and the "my-ns:" namespace prefix was added to the root node without me having to modify any code ! So I wouldn't have to write a Soap Extension after all !