Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. WebService SoapInclude, custom classes?

WebService SoapInclude, custom classes?

Scheduled Pinned Locked Moved C#
graphicsxmljsonhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    methodincharge
    wrote on last edited by
    #1

    Yeah so I created a nice little Web Service that returned a custom class called Site which has 3 strings and an int. I kept getting:

    System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type PortalService.Site was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
    at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType)

    And I used both XmlInclude and SoapInclude to no avail. So I said screw it and created a string with a delimiter that I could parse when it returned to the client. Perfect. Except now when I call the WebService, the webpage's graphics don't load completely and at random. I suppose this perhaps attributed to the fact that I just did <% Function() %> since the basic Repeater did not suite my needs. Any suggestions?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups