locked
Are strings not serializable? RRS feed

  • Question

  • Are strings not able to be serialized by DSS? I keep getting the following error when sending a message whose body has a string member:

    SerializerServiceTongue TiederializeToXmlWriter. Exception:Type does not have a root element name so it can't be serializedTongue Tiedystem.String
    Tuesday, May 1, 2007 9:30 PM

Answers

  • what you are doing seems fine, i dont see anything wrong and its similar to what our samples do. You can use properties or directly fields, we support both
    Thursday, May 3, 2007 1:46 PM
  • Do you see the serialization when you do an HTTP GET against your service, for example?

     

    Henrik

    Thursday, May 3, 2007 6:18 PM

All replies

  • Bodies with string members are definately serializable (most of our samples have data types with string fields).

     

    Make sure your class, that is your body for your operation, has the following attrbutes

    1) DataContract on the class definition

    2) DataMember on the field in question

    Wednesday, May 2, 2007 4:44 PM
  • Yes, they declare the appropriate attributes, this is the message body in question: 

    [DataContract]

    public class PerformActionRequest {         

        [DataMember]

        public string ActionName;

    }



    I notice that a lot of the samples have a property member instead of a field member. Should I be using a property instead or is that just a matter of choice?

    Thursday, May 3, 2007 8:55 AM
  • what you are doing seems fine, i dont see anything wrong and its similar to what our samples do. You can use properties or directly fields, we support both
    Thursday, May 3, 2007 1:46 PM
  • Do you see the serialization when you do an HTTP GET against your service, for example?

     

    Henrik

    Thursday, May 3, 2007 6:18 PM