我如何定义消息契约来获得这种 XML SOAP 格式?
架构:
<List>
<Exclusions>
<ExclusionID>123</ExclusionID>
<ExclusionID>656</ExclusionID>
</Exclusions>
</List>
我创建了如下所述的类文件,但它给出了不同的响应
<DataContract> _
Public Class List
''' <remarks/>
Private _exclusions As Exclusions
<DataMember()> _
Public Property Exclusions() As Exclusions
Get
Return _exclusions
End Get
Set(ByVal value As Exclusions)
_exclusions = value
End Set
End Property
End Class
<DataContract>
Public Class Exclusions
<DataMember>
Public ExclusionID As ExclusionID()
End Class
<MessageContract>
Public Class ExclusionID
<MessageBodyMember(Name:="")>
Public Value As String
End Class
我的回复是这样的:
<List >
<Exclusions >
<ExclusionID>
<ExclusionID>
<Value>123</Value>
</ExclusionID>
<ExclusionID>
<Value>145</Value>
</ExclusionID>
</ExclusionID>
</Exclusions>
</List>
如何使用消息合约获得正确的消息?