?
Solved

Creating a webservice in ASP.net that accepts an array

Posted on 2007-08-08
2
Medium Priority
?
743 Views
Last Modified: 2013-11-05
Im trying to create a method for a web service that accepts an array parameter. However I get the following error when trying to run the web service:

You must implement a default accessor on System.Array because it inherits from ICollection.

My code so far is:

Public Class TravelQuote
    Inherits System.Web.Services.WebService

    Private _superPrice As Decimal = 0

    <WebMethod()> _
    Public Function GetQuote(ByVal product As String, ByVal destination As String, ByVal grouptype As String, ByVal duration As String, ByVal ages As Array) As String

        Return 0

    End Function

How do I fix the service to allow the passing of an array?
0
Comment
Question by:g-spot
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 19654785
Try this:


 Public Function GetQuote(ByVal product As String, ByVal destination As String, ByVal grouptype As String, ByVal duration As String, ByVal ages As Integer()) As String


Bob
0
 

Author Comment

by:g-spot
ID: 19655480
Thank you Bob!!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question