none
Trouble using SoapTypeAttribute to deserialize array of strings RRS feed

  • Question

  • Hi,

     I am trouble deserializing a SOAP message that has array of keys as show below. Please note at the Keys tag on both the root and the items in the array. I have defined following object to deserialize this but it is not working.

     

    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ObjectId" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://test.com/types" xmlns="">
          <Keys soapenc:arrayType="xsd:string[3]" xsi:type="soapenc:Array">
            <Keys xsi:type="xsd:string">CCSF</Keys>
            <Keys xsi:type="xsd:string">CAP</Keys>
            <Keys xsi:type="xsd:string">13CAP-00000-001E3</Keys>
          </Keys>
          <IdentifierDisplay xsi:type="xsd:string">SU2013-000007</IdentifierDisplay>
          <Value xsi:type="xsd:string"></Value>
          <contextType xsi:type="xsd:string"></contextType>
    </multiRef>

     

     

    [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace = "http://test.com/types")]
    public partial class ObjectId
    {

        private string[] keysField;

        private string identifierDisplayField;

        private string valueField;

        private string contextTypeField;

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable = false)]
        public string[] Keys
        {
            get
            {
                return this.keysField;
            }
            set
            {
                this.keysField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)]
        public string IdentifierDisplay
        {
            get
            {
                return this.identifierDisplayField;
            }
            set
            {
                this.identifierDisplayField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable = true)]
        public string Value
        {
            get
            {
                return this.valueField;
            }
            set
            {
                this.valueField = value;
            }
        }

        /// <remarks/>
        public string contextType
        {
            get
            {
                return this.contextTypeField;
            }
            set
            {
                this.contextTypeField = value;
            }
        }
    }

     

     

    Monday, December 23, 2013 11:02 PM