1
如何定義消息合約以獲取此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>
如何才達到使用消息合約的正確消息?