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. WCF knowntypes

WCF knowntypes

Scheduled Pinned Locked Moved C#
csharpwcfcomdata-structuresjson
3 Posts 3 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.
  • 1 Offline
    1 Offline
    1eyhk1
    wrote on last edited by
    #1

    Curious - for simple array such as string[], if I declare known type from interface, they just won't show on object browser (but other custom/non-System types developed in-house can), thus the infamous: There was an error while trying to serialize parameter http://CalcProcessWCF:req. The InnerException message was 'Type 'System.String[]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. I have to resort to set it programmatically from proxy in order to get it working: foreach (var operation in proxy.Endpoint.Contract.Operations) { operation.KnownTypes.Add(typeof(MyDynamicallyAddedKnownType)); } why...

    P realJSOPR 2 Replies Last reply
    0
    • 1 1eyhk1

      Curious - for simple array such as string[], if I declare known type from interface, they just won't show on object browser (but other custom/non-System types developed in-house can), thus the infamous: There was an error while trying to serialize parameter http://CalcProcessWCF:req. The InnerException message was 'Type 'System.String[]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. I have to resort to set it programmatically from proxy in order to get it working: foreach (var operation in proxy.Endpoint.Contract.Operations) { operation.KnownTypes.Add(typeof(MyDynamicallyAddedKnownType)); } why...

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Ummm... what? You must be doing something wrong.

      1 Reply Last reply
      0
      • 1 1eyhk1

        Curious - for simple array such as string[], if I declare known type from interface, they just won't show on object browser (but other custom/non-System types developed in-house can), thus the infamous: There was an error while trying to serialize parameter http://CalcProcessWCF:req. The InnerException message was 'Type 'System.String[]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. I have to resort to set it programmatically from proxy in order to get it working: foreach (var operation in proxy.Endpoint.Contract.Operations) { operation.KnownTypes.Add(typeof(MyDynamicallyAddedKnownType)); } why...

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        You're asking this in the wrong forum. Use the WCF forum instead.

        .45 ACP - because shooting twice is just silly
        -----
        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

        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