Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Passing ParamArray to a webservice

Reply
Thread Tools

Passing ParamArray to a webservice

 
 
rituchandra0972@gmail.com
Guest
Posts: n/a
 
      10-13-2006
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

 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-13-2006
<> wrote in message
news: ps.com...
> 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.


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to call a WEBSERVICE in another WEBSERVICE (AXIS/ TOMCAT) Cyril Java 2 06-01-2006 06:07 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 1 01-26-2006 12:05 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista ASP .Net 0 01-26-2006 08:13 AM
WebService on Java server versus WebService on .NET Mr. x Java 2 10-09-2003 11:21 PM
use another webservice in a webservice Mr. x ASP .Net Web Services 0 09-26-2003 10:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57