我一直在尝试让 web 服务在我的 localhost 中工作并进行调试,但它给了我这个错误:
System.InvalidOperationException:“ParticipantDataService.Participant+OutsideAccountDetails+FundCollection”类型的 DataContract 无法添加到 DataContractSet,因为名称空间“http://schemas.datacontract”中具有相同数据合同名称“ArrayOfFundDetails”的“ParticipantDataService.Participant+FundCollection”类型。 org/2004/07/ParticipantDataService' 已经存在,并且合同不等效。
有没有人以前有这个错误?
谢谢。
下面的删节代码(注意:不是我的代码。我正在修改以前的开发人员的代码,他已经不在这里了。也是一个带有网络服务的菜鸟。在下面的这个代码块中,因为这个问题现在似乎与资金有关,我已经使所有“资金”参考文献比其他参考文献更明显。谢谢。)
Namespace COMParticipantNameSpace
<DataContract(Namespace:="XYZ", Name:="COMParticipant"),
KnownType(GetType(COMParticipant))> _
Public Class COMParticipant
Inherits COMResponse
Private _FullName As FullName
(Other initialized variables...)
Protected Friend Sub New...
#Region "Properties"
<DataMember(Name:="Name", Order:=0)>...
<Other DataMembers...>
#End Region
#Region "Structures"
Public Structure FullName...
(Other Public Structures)
#End Region
#Region "Classes"
<DataContract(Name:="ParticipantPortfolio")>....
Public Class GroupCollection...
End Class
<DataContract(Name:="Group")>...
<DataMember(Name:="Funds", Order:=6)> _
Public Property Funds() As COMFundCollection
Get
Return _Funds
End Get
Set(ByVal value As COMFundCollection)
_Funds = value
End Set
End Property
End Class
Public Class COMAccountCollection
Inherits System.Collections.ObjectModel.Collection(Of COMAccountDetails)
End Class
<DataContract(Name:="COMAccountDetails")> _
Public Class COMAccountDetails
(Other initialized variables...)
Private _Funds As COMFundCollection
<DataMember Order 0,1,2,3,etc...)>...
<DataMember(Name:="Funds", Order:=7)> _
Public Property Funds() As COMFundCollection
Get
Return _Funds
End Get
Set(ByVal value As COMFundCollection)
_Funds = value
End Set
End Property
End Class
Public Class COMFundCollection
Inherits System.Collections.ObjectModel.Collection(Of COMFundDetails)
End Class
Public Class OutsideAccountCollection
End Class
<DataContract(Name:="OutsideAccountDetails")> _
Public Class OutsideAccountDetails
(Other initialized variables...)
Private _Funds As FundCollection
<Order 1, 2, 3, etc...>
<DataMember(Name:="Funds", Order:=15)> _
Public Property Funds() As FundCollection
Get
Return _Funds
End Get
Set(ByVal value As FundCollection)
_Funds = value
End Set
End Property
Public Class FundCollection
Inherits System.Collections.ObjectModel.Collection(Of FundDetails)
End Class
<DataContract(Name:="FundDetails")>...
End Class
Public Class TransactionTypeCollection
Inherits System.Collections.ObjectModel.Collection(Of TransactionTypeDetail)
End Class
Public Class TransactionTypeDetail...
Public Class TransactionCollection...
<DataContract(Name:="Transaction")> _
Public Class Transaction
(Other initialized variables...)
Private _Funds As TransactionFundCollection
<DataMember Order 1,2,3,etc ...>
<DataMember(Name:="Funds", Order:=7)> _
Public Property Funds() As TransactionFundCollection
Get
Return _Funds
End Get
Set(ByVal value As TransactionFundCollection)
_Funds = value
End Set
End Property
End Class
Public Class TransactionFundCollection
Inherits System.Collections.ObjectModel.Collection(Of TransactionFundDetails)
End Class
#End Region
End Class
End Namespace}