Passing an Array of Strings to a WebService
How do you pass an array of strings to a webservice?
I have a Webservice that takes in an array of strings and return a concatination of these strings:
<WebMethod()> _
Public Function HelloWorld(ByVal the() As String) As String
Dim rtn As String = ""
Dim i As Integer
For i = 0 To the.Length
rtn = the(i).ToString & " " & rtn
Next
Return rtn
End Function
I want to use an excel XP worksheet to call this webservice:
Private Sub CommandButton1_Click()
Dim ExampleVar As New clsws_Service1
Dim rtn As String
Dim stringPassed(1) As String
stringPassed(0) = "Hello"
stringPassed(1) = "World"
rtn = ExampleVar.wsm_Test(stringPassed)
MsgBox (rtn)
End Sub
Currently it is telling me that I have a compile error because the type is mismatched. Can anyone help?
|