SOAP encoding

Discussion in 'ASP .Net Web Services' started by Random, May 3, 2005.

  1. Random

    Random Guest

    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??
     
    Random, May 3, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Casper Hornstrup

    Html encoding SOAP response

    Casper Hornstrup, Dec 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,716
    Martin Honnen
    Dec 15, 2003
  2. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    19,052
    Jon Skeet [C# MVP]
    Jun 9, 2004
  3. Replies:
    1
    Views:
    23,572
    Real Gagnon
    Oct 8, 2004
  4. VanMan
    Replies:
    0
    Views:
    529
    VanMan
    Sep 23, 2007
  5. Replies:
    2
    Views:
    419
Loading...

Share This Page