Web Service problem

Discussion in 'ASP .Net Web Services' started by Paul K, Aug 20, 2004.

  1. Paul K

    Paul K Guest

    I have a pretty basic Web Method (see below) that accepts an arraylist and a
    string, and returns an arraylist.

    The problem I am running into is that if I send an arraylist containing any
    objects, the proxy class breaks saying that type is not expected. In this
    case, I am trying to send an arraylist of PSI.Common.Inspection objects.

    From what I understand, if I added a XmlArrayItem attribute to the
    inspections parameter it would then expect PSI.Common.Inspection objects.

    Could anyone let me know if my understanding is correct? If it is, how do I
    add the attribute? No matter where I try to place it, I always get a
    compiler error.

    The web method follows:

    <WebMethod(), _
    XmlInclude(GetType(PSI.Common.Applicant)), _
    XmlInclude(GetType(PSI.Common.ApplicantProperty)), _
    XmlInclude(GetType(PSI.Common.Contractor)), _
    XmlInclude(GetType(PSI.Common.ContractorType)), _
    XmlInclude(GetType(PSI.Common.Inspection)), _
    XmlInclude(GetType(PSI.Common.InspectionType)), _
    XmlInclude(GetType(PSI.Common.Municipality)), _
    XmlInclude(GetType(PSI.Common.Permit)), _
    XmlInclude(GetType(PSI.Common.PermitContractor))> _

    Public Function SynchronizeClient(ByVal inspections As
    System.Collections.ArrayList, ByVal inspectorAccountName As String) As
    <XmlArrayItemAttribute(GetType(PSI.Common.Permit))>
    System.Collections.ArrayList
    MgrObject.ConnectionString =
    ConfigurationSettings.AppSettings("ConnectionString")

    Dim str As String = Context.User.Identity.Name

    If inspectorAccountName.Length > 0 Then
    If mIMgr.CompleteInspections(inspections) <> ErrorCodes.None Then Throw
    New System.SystemException("An unknown error occurred while attempting to
    synchronize the provided data with the database.")
    Return PMgr.GetPermitsForInspector(inspectorAccountName)
    End If
    End Function
    Paul K, Aug 20, 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. hocho888
    Replies:
    1
    Views:
    630
  2. dgleeson422111

    Consuming local web service - ok, remote web service -problem?

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    903
    dgleeson422111
    Jan 26, 2010
  3. Scott Baierl
    Replies:
    1
    Views:
    279
    Scott Baierl
    Jul 29, 2006
  4. Leo Violette
    Replies:
    0
    Views:
    1,026
    Leo Violette
    Apr 17, 2009
  5. Redhot
    Replies:
    0
    Views:
    767
    Redhot
    Jul 18, 2009
Loading...

Share This Page