passing NameValueCollection as parameter to Web Service

Discussion in 'ASP .Net Web Services' started by Al, Jan 14, 2004.

  1. Al

    Al Guest

    In my new web services I am attempting to pass a NameValueCollection as a
    parameter and return a class object to the calling client. Both the calling
    application and the services are written with VB.NET.

    Some of the code:
    -----------------------------------------------------
    <WebMethod(Description:="Create Note")> _
    Public Function CreateNote(ByVal StoreIndexValues As
    NameValueCollection, ByVal NoteContent As String, ByVal UserID As String,
    ByVal Options As NameValueCollection) As CCMSMessage

    Dim xCCMS As New CCMS()
    Dim xResult As New CCMSMessage()

    xResult = xCCMS.CreateNote(StoreIndexValues, NoteContent, UserID,
    Options)

    Return xResult
    End Function
    --------------------------------------------------------------


    When the client tries to set a reference to the web service, or I just
    try to run the start page from the VS IDE, I get the following error:

    The error:
    ---------------------------------------------------------
    You must implement the Add(System.String) method on
    System.Collections.Specialized.NameValueCollection because it inherits from
    ICollection.
    --------------------------------------------------------

    I don't understand this message and I can't find a similar situation on the
    web. Is it not possible to pass a NameValueCollection as a parameter to a
    web service?

    Thanks in advance for any responses.
    Al, Jan 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Miller
    Replies:
    1
    Views:
    1,081
    Mark Miller
    Jul 18, 2003
  2. Yuri Vanzine
    Replies:
    0
    Views:
    2,821
    Yuri Vanzine
    Aug 18, 2003
  3. Alfons Puig
    Replies:
    1
    Views:
    1,527
    Shaji
    Aug 28, 2003
  4. anon
    Replies:
    5
    Views:
    695
    Chris R. Timmons
    May 14, 2004
  5. Julia
    Replies:
    1
    Views:
    509
    Girish bharadwaj
    Sep 23, 2004
Loading...

Share This Page