Passing List<string> in WCF Rest Post Method -


i trying pass list in wcf post call parameter. below code.

trackingnumbers.cs  [knowntype(typeof(list<string>))] [datacontract] public class trackingnumbers {     [datamember]     public list<object> trackingnumberlist { get; set; } }      iservice.cs      [operationcontract]     [webinvoke(method = "post",         requestformat = webmessageformat.xml,         responseformat = webmessageformat.xml,         bodystyle = webmessagebodystyle.bare,         uritemplate = "v1/xml/getmultipleshipmentdetails/")]     shipments[] xmlmultipledata(trackingnumbers trackingnumbers); 

now when passing following xml fiddler

<trackingnumbers xmlns="http://schemas.datacontract.org/2004/07/chhotu.web.partner.api"> <trackingnumberlist>10000008871</trackingnumberlist> <trackingnumberlist>10000008864</trackingnumberlist> <trackingnumberlist>10000008858</trackingnumberlist> </trackingnumbers> 

the xmlmultipledata method not getting called debugger. please suggest doing wrong.

i see issues our code:

  • no need [knowntype(typeof(list))], datacontractserializer knows type already.
  • list - not approach. if use numbers why not make int?

are sure attached? can try enforce attaching of debugger debugger.break(); @ position in code.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -