R
rituchandra0972
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
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