![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Hi Allen, Thanks for quick response. String array is not named-value pair collection(single dimention), and we can not use multidimetional array in webmethod declaration as well. It will make my life easier, if i can get some sort of Named-Value pair in my webmethod declaration (as an alternate of SortedList). Any suggestion will be highly appreciated. Thanks Faiz Faiz "Brock Allen" wrote: Well, you can use arrays, as those do map ok into XML Schema: [WebMethod] void YourMethod(string[] items) { } And then you'll have to do the sorting yourself. That's easy, with Array.Sort(items); -Brock DevelopMentor http://staff.develop.com/ballen Hi Allen, I really appreciate that you replied to my question. I am new to Web Service development. I went to the link mentioned in your reply, but I am not able figure out how it is going to solve my problem(new to WS). I understand that we can not specify Sorted List as parameter for WebMethod, so what OTHER OPTIONS DO WE HAVE, which offers the same functionality Name-Value pair without using Sorted List(limitation with webmethod). Explanation: my scenario is: MyWebMethod(v_filterCriteria As SortedList) { ... talk to db and execute query with WHERE clause equal to items in v_filterCriteria. } The client can create a sortedlist object and add some filter criteria and send it to web method as MyWebMethodClinet() { Dim objSortedList as sortedlist objSortedList.add(a,1) objSortedList.add(b,2) MyWebMethod(objSortedList) } Thanks in advance. Faiz "Brock Allen" wrote: SortedList is a .NET class and shouldn't be used as a parameter to a Webmethod. I just posted earlier today discussing why things like this aren't by design in Web Services. Here's the link: http://groups-beta.google.com/group/...dotnet.framewo rk .aspnet.webservices/browse_thread/thread/8989a6ff68d23be4/37e6b9f3c 05 f75c8#37e6b9f3c05f75c8 So, in short, you need to design around XML and XML Schema and then figure out how to represent it in your .NET code. -Brock DevelopMentor http://staff.develop.com/ballen It seems like, it is not allowed to specify a parameter of type SortedList in WebMethod signature, Is is true? What other option(s) do we have to pass in a named-value piar to a web method? i am using vb.net for creating web service. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |