views:

815

answers:

3

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

Scott does say:

If you want the code, and to go to hell, email me

Here, that's probably the best route if no-one has any ideas.

TreeUK
+1  A: 

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 !

Preets
Did you happen to try it out in .NET 2.0 ?
Cerebrus
No not 2.0, I tried 3.5 ! But I suppose it should, considering that you too got the prefix in the root node.
Preets
There are code attributes for specifying the namespace of the response element.
Cheeso
A: 

Ya I do want the code.

Masroor Tariq