SOAP encoding

R

Random

I have a WebMethod that is returning a custom class, but am having a
problem with the SOAP serialization. Everything actually works fine, except
the root node of the serialized class gets changed to match the WebMethod.

So, where I have my class...

Public Class MyCustomClass
........(class properties)
End Class

....in normal serialization, it all comes out the way I want,...

<MyCustomClass xmlns="http://wwwmynamespace.org/">
..........(xml serialized properties)
</MyCustomClass>


But my WebMethod...

<WebMethod(Description:="Returns a custom class")> _
Public Function MyMethod() As MyCustomClass
...(perform object instantiation and set properties)
End Function

gives me in the SOAP body...

<MyMethod xmlns=="http://wwwmynamespace.org/">
........(xml serialized properties)
</MyMethod>

I'm trying to apply various XmlRoot and SoapElement attributes to the
WebMethod, but VS keeps telling me that those attributes are not valid on
this declaration type. What am I missing??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top