Subject: Passing an Array of Strings to a WebService
Posted By: rmau Post Date: 10/27/2003 2:59:14 PM
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?


Go to topic 3054

Return to index page 1018
Return to index page 1017
Return to index page 1016
Return to index page 1015
Return to index page 1014
Return to index page 1013
Return to index page 1012
Return to index page 1011
Return to index page 1010
Return to index page 1009