Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2006

Tip: Looking for answers? Try searching our database.

Passing ParamArray to a webservice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rituchandra0972@gmail.com - 13 Oct 2006 20:17 GMT
Hi,

I have a webservice with a webmethod that accepts two parameters
defined as
       <WebMethod()> _
           Public Function GetData(ByVal strID As String, _
                          ByVal ParamArray Params As String()) As
Xml.XmlNode

When this web service is consumed in front end, the proxy class
generates a signature that looks something like this

       Public Function GetData(ByVal strID As String, ByVal Params()
As String) As System.Xml.XmlNode

If you notice the keyword 'ParamArray' is missing. Now when I send
multiple parameters all is fine. That is if the call looks something
like this

Arr(0) = "Test"
xmlData = GetData("SOME_STRING", Arr)

The code goes through fine. But if I try something like this

Arr(0) = "Test"
xmlData = GetData("SOME_STRING")  ' with the second paramArray
parameter missing

then I get compilation error. This is because the signature of the
calling function does not match with that of the proxy generated for
the consumer app. But if I change the signature of the proxy function
explictly to something like this

Public Function GetData(ByVal strID As String, ByVal ParamArray Params
As String()) As System.Xml.XmlNode

Then it works.

What can I do to ensure that the proxy is correctly generated from the
webmethod signature for ParamArray cases?

Would appreciate some insights into the matter.

Thanks
Ritu
John Saunders - 13 Oct 2006 22:55 GMT
> Hi,
>
[quoted text clipped - 38 lines]
>
> Would appreciate some insights into the matter.

There is no such thing as ParamArray in web services!

Consider that web services are meant to be cross-platform. Many (if not
most) platforms don't have the concept of "paramarray".

John

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.