为什么我不能在.net 2010 Web服务中看到类?

时间:2013-12-31 17:46:49

标签: web-services web asmx asp.net-1.1

在.net 2010中,我有一个相当简单的类,我需要通过Web服务公开一个函数。它使用几个基本的自定义类,消费者理论上可以填充数据并发回给我。问题是,在我创建WebService然后尝试使用该服务之后,它只能看到函数中提到的函数和两个顶级类。没有提供顶级类属性的类可用。

我在vs 2005中完成了这个,代理会生成一个reference.vb文件,该文件将拼写出所使用的类。但我在2010年没有看到该文件。

这是一个例子。在主类下面,Application可用于代理,但它的属性类都不是。

<Serializable()> _
Public Class Income
    Public Property monthly() As Integer
    Public Property wages() As Integer
    Public Property taxableInterest() As Integer
    Public Property taxExemptInterest() As Integer
    Public Property taxableRefunds() As Integer
    Public Property alimony() As Integer
    Public Property capitalGains() As Integer
    Public Property pensions() As Integer
    Public Property farmIncome() As Integer
    Public Property unemployment() As Integer
    Public Property other() As Integer
    Public Property MAGIDeductions() As Integer
End Class
<Serializable()> _
Public Class Applicant

    Public Sub New()
        _relationships = New ArrayList 
        _income = New Income
    End Sub

    Public Property isApplicant() As String
    Public Property disabled() As String
    Public Property student() As String
    Public Property eligible() As String
    Public Property incarcerated() As String
    Public Property livesInState() As String
    Public Property claimedByNonApplicant() As String
    Public Property longTermCare() As String
    Public Property hasInsurance() As String
    Public Property stateEmployeeHealthBenefits() As String
    Public Property priorInsuranceIndicator() As String
    Public Property pregnant() As String
    Public Property pregnantThreeMonths() As String
    Public Property formerlyFosterCare() As String
    Public Property incomeTaxesRequired() As String
    Public Property citizen() As String
    Public Property id() As String
    Public Property age() As Int32
    Public Property hours() As Int32
    Public Property temporarilyOutOfState As String
    Public Property noFixedAddress As String
    Public Property claimerIsOutOfState As String
    Public Property endDate As String
    Public Property numberOfChildrenExpected As String
    Public Property hadMedicaid As String
    Public Property ageLeftFosterCare As String
    Public Property state As String
    Public Property legalPermanentResident As String
    Public Property lawful As String
    Public Property fiveYearBar As String
    Public Property fortyQuarters As String
    Public Property fiveYearBarMet As String
    Public Property refugeeMedicalAssistanceEligible As String
    Public Property humanTraffickingVictim As String
    Public Property startDate As String
    Public Property qualified As String
    Public Property deportWithheldDate As String
    Public Property entryDate As String
    Public Property statusGrantDate As String
    Public Property income() As Income
    Public Property relationships() As ArrayList 
End Class
<Serializable()> _
Public Class Resident 
    Public Property id() As String
End Class
<Serializable()> _
Public Class Household
    Public Sub New()
        _People = New ArrayList 
    End Sub
    Public Property HouseholdID() As String
    Public Property People() As ArrayList 
End Class
<Serializable()> _
Public Class Filer
    Public Property id() As String
End Class
<Serializable()> _
Public Class taxReturn
    Public Sub New()
        _Filers = New ArrayList 
        _Dependents = New ArrayList 
    End Sub
    Private _Filers As ArrayList 
    Private _Dependents As ArrayList 
    Public Property Filers() As ArrayList 
        Get
            Return _Filers
        End Get
        Set(value As ArrayList) 
            _Filers = value
        End Set
    End Property
    Public Property Dependents() As ArrayList 
        Get
            Return _Dependents
        End Get
        Set(value As ArrayList) 
            _Dependents = value
        End Set
    End Property

End Class
<Serializable()> _
Public Class Application

    Public Sub New()
        _People = New ArrayList 
        _PhysicalHouseholds = New ArrayList 
        _TaxReturns = New ArrayList
    End Sub

    Private _applicationID As String = "TEST

    Public Property State() As String
    Public Property Name() As String
        Get
            Return _applicationID
        End Get
        Set(value As String)
            _applicationID = value
        End Set
    End Property
    Public Property People() As ArrayList 
    Public Property PhysicalHouseholds() As ArrayList 
    Public Property TaxReturns() As ArrayList 

End Class

0 个答案:

没有答案