Passing a web service an unknown number of parameters

Posted by Billyhole on Stack Overflow See other posts from Stack Overflow or by Billyhole
Published on 2010-04-28T14:44:23Z Indexed on 2010/05/14 20:54 UTC
Read the original article Hit count: 221

I'm relatively new to utilizing web services. I'm trying to create one that will be accepting data from a ASP.Net form whose input controls are created dynamically at runtime and I don't how many control values will be getting passed.

I'm thinking I'll be using jQuery's serialize() on the form to get the data, but what do I have the web service accept for a parameter? I thought maybe I could use serializeArray(), but still I don't know what type of variable to accept for the JavaScript array.

Finally, I was thinking that I might need to create a simple data transfer object with the data before sending it along to the web service. I just didn't wanna go through with the DTO route if there was a much simpler way or an established best practice that I should follow.

Thanks in advance for any direction you can provide and let me know I wasn't clear enough, or if you have any questions.

© Stack Overflow or respective owner

Related posts about web-services

Related posts about JSON