Hi,
i'm new with c# and web service, trying to read the xml Soap request but the intelligence keeps saying it's not right... i'm out of idea... please help!!
here's client xml request, I removed duplicate items for easy read:
<pre><tem:Request>
<pix:cname>Testaccount</pix:cname>
<pix:sclass>sales</pix:sclass>
<pix:PO>PO12345</pix:PO>
<pix:method>AIR</pix:method>
<pix:product>
<pix:style>Abc1</pix:style>
<pix:qty>1</pix:qty>
<pix:price>1.00</pix:price>
</pix:product>
<pix:product>
<pix:style>Cde1</pix:style>
<pix:qty>2</pix:qty>
<pix:price>1.00</pix:price>
</pix:product>
</tem:Request>
I have 2 classes:
class order
<pre>[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
<pre> [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
<pre>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());
thank you in advance!!
What I have tried:
listItem = HttpUtility.HtmlAttributeEncode(SerializableAttribute.GetCustomAttributes.items());