WCF service with list array request


i'm newbie in C# and web service but i need to read the soap service (xml format) and save it to a SQL tables (dataset)...

here's my client's data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:pix="">

I have 2 classes:
class order
            [MessageBodyMember(Order = 0)]
            public string wsVersion { get; set; }
            [MessageBodyMember(Order = 1)]
            public string cname { get; set; }
            [MessageBodyMember(Order = 2)]
            public string PO { get; set; }
            [MessageBodyMember(Order = 3)]
            public string method { get; set; }
            [MessageBodyMember(Order = 4)]
            [XmlArrayItem("oItems", IsNullable = false)]
            public Item[] Items { get; set; }
class Item
            [XmlElement(Order = 0)]
            public string style { get; set; }
            [XmlElement(Order = 1)]
            public int qty { get; set; }
            [XmlElement(Order = 2)]
            public double price { get; set; }

in service.svc.cs

wsVersion = httpUtility.HtmlEncode(request.wsVersion);
cname= httpUtility.HtmlEncode(request.cname);
PO= httpUtility.HtmlEncode(request.PO);
method= httpUtility.HtmlEncode(request.method);

items = new Item();
listItem = new List<Item>();
listItem.style = HttpUtility.HtmlEncode(request.item.style());  <---

i do not know how to read the xml element array, should i just use reader at the very beginning?
can someone give me a hint or something? should i not use httpUtility.HtmlEncode?...

thank you!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:

sorry,but I could not fully understand the question.

Are you developing a WCF service which should get the above SOAP structure?
Or are you consuming another service which returns the above elements?

Thanks for clarification,
IUSRAuthor Commented:
Hi Rainer,
yes, i'm developing a WCF service, the client will send me the SOAP structure request and i reply with order number.
but i'm having problem reading the request, i can read the single nodes without any issue but the product array is difficult and i do not know how many items will be.
-i tried xml deserialize the whole request but encounter the "Object reference not set to an instance of an object."
-trying the FastMember from NuGet Packages but the red wavy underline showing my array object is unknown...

any suggestion on how to properly read xml request with array items is greatly appreciate...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.