Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Define multiple variables with the same initial value Pin
Guffa17-Feb-09 23:24
Guffa17-Feb-09 23:24 
QuestionMy regular expression skiping one data How can I fix it [modified] Pin
Naveed72717-Feb-09 18:09
Naveed72717-Feb-09 18:09 
QuestionSocket issue Pin
yesu prakash17-Feb-09 17:54
yesu prakash17-Feb-09 17:54 
AnswerRe: Socket issue Pin
carbon_golem18-Feb-09 2:28
carbon_golem18-Feb-09 2:28 
GeneralRe: Socket issue Pin
yesu prakash18-Feb-09 17:57
yesu prakash18-Feb-09 17:57 
QuestionC# Web Service Custom Return Object Problem Pin
WhatDoIHaveToDoToGetAUniqueName17-Feb-09 10:54
WhatDoIHaveToDoToGetAUniqueName17-Feb-09 10:54 
AnswerRe: C# Web Service Custom Return Object Problem Pin
Calin Tatar17-Feb-09 11:05
Calin Tatar17-Feb-09 11:05 
GeneralRe: C# Web Service Custom Return Object Problem [modified] Pin
WhatDoIHaveToDoToGetAUniqueName17-Feb-09 12:37
WhatDoIHaveToDoToGetAUniqueName17-Feb-09 12:37 
I see the custom object in the client app just fine.

I just tried adding [SoapInclude(typeof(CustomObject))] attribute to the custom object (and yes I did replace "CustomObject" with the actual object), but unfortunately I get the same result. (I also tried it with [XmlInclude(typeof(CustomObject))], same result.) All arrays are zero length and I get the 'out of bounds' error if I try and access any of the elements of an array.

Any other ideas? I haven't been able to find an example of something similar to what I'm doing as far as nesting arrays of common types inside a custom web service return object.

EDIT:

I just tried adding [XmlElement()] attribute to each array property, and the fields in the object became null. I then tried [XmlArray()] instead and got the same result. Here's my object as it exists now:

    /// <summary>
    /// Result object for 'Ping' web method.
    /// </summary>
    [SoapInclude(typeof(PingResult))]
    [Serializable()]
    public class WebMethodResult
    {
        private Int32 a;
        private String[] b;
        private UInt32[] c;
        private UInt32[] d;
        private UInt32[] e;
        private Int16[] f;

        public Int32 A
        {
            get { return this.a; }
            set { this.a= value; }
        }
        [XmlArray()]
        public String[] B
        {
            get { return this.b; }
            set { this.b= value; }
        }
        [XmlArray()]
        public UInt32[] C
        {
            get { return this.c; }
            set { this.c= value; }
        }
        [XmlArray()]
        public UInt32[] D
        {
            get { return this.d; }
            set { this.d= value; }
        }
        [XmlArray()]
        public UInt32[] E
        {
            get { return this.e; }
            set { this.e= value; }
        }
        [XmlArray()]
        public Int16[] F
        {
            get { return this.f; }
            set { this.f= value; }
        }

        public WebMethodResult() 
        {
            //leave empty - serializer constructor
        }
}


modified on Tuesday, February 17, 2009 7:14 PM

GeneralRe: C# Web Service Custom Return Object Problem Pin
Ennis Ray Lynch, Jr.17-Feb-09 15:21
Ennis Ray Lynch, Jr.17-Feb-09 15:21 
GeneralRe: C# Web Service Custom Return Object Problem [modified] Pin
WhatDoIHaveToDoToGetAUniqueName18-Feb-09 10:00
WhatDoIHaveToDoToGetAUniqueName18-Feb-09 10:00 
GeneralRe: C# Web Service Custom Return Object Problem Pin
Ennis Ray Lynch, Jr.18-Feb-09 10:22
Ennis Ray Lynch, Jr.18-Feb-09 10:22 
GeneralRe: C# Web Service Custom Return Object Problem Pin
WhatDoIHaveToDoToGetAUniqueName18-Feb-09 12:55
WhatDoIHaveToDoToGetAUniqueName18-Feb-09 12:55 
QuestionParsing Line by line Pin
alwaysthinking17-Feb-09 10:40
alwaysthinking17-Feb-09 10:40 
AnswerRe: Parsing Line by line Pin
Calin Tatar17-Feb-09 11:01
Calin Tatar17-Feb-09 11:01 
AnswerRe: Parsing Line by line Pin
PIEBALDconsult17-Feb-09 12:46
mvePIEBALDconsult17-Feb-09 12:46 
GeneralRe: Parsing Line by line Pin
alwaysthinking17-Feb-09 13:35
alwaysthinking17-Feb-09 13:35 
GeneralRe: Parsing Line by line Pin
PIEBALDconsult17-Feb-09 15:21
mvePIEBALDconsult17-Feb-09 15:21 
Question[Message Deleted] Pin
wwwxyz17-Feb-09 10:08
wwwxyz17-Feb-09 10:08 
AnswerRe: how can I apply all txt files in the folder this code? Pin
DaveyM6917-Feb-09 10:19
professionalDaveyM6917-Feb-09 10:19 
General[Message Deleted] Pin
wwwxyz17-Feb-09 10:24
wwwxyz17-Feb-09 10:24 
GeneralRe: how can I apply all txt files in the folder this code? Pin
Calin Tatar17-Feb-09 10:36
Calin Tatar17-Feb-09 10:36 
General[Message Deleted] Pin
wwwxyz17-Feb-09 10:39
wwwxyz17-Feb-09 10:39 
GeneralRe: how can I apply all txt files in the folder this code? Pin
Calin Tatar17-Feb-09 10:56
Calin Tatar17-Feb-09 10:56 
GeneralRe: how can I apply all txt files in the folder this code? Pin
wwwxyz17-Feb-09 11:35
wwwxyz17-Feb-09 11:35 
GeneralRe: how can I apply all txt files in the folder this code? Pin
Calin Tatar17-Feb-09 11:40
Calin Tatar17-Feb-09 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.