【发布时间】:2015-08-05 21:13:05
【问题描述】:
在我的 WCF 服务中,我有以下 OperationContract:
<OperationContract()>
Function getResults(ByVal Settings As Dictionary(Of String, String)) As IO.Stream
...和 MessageContract:
<MessageContract()>
Public Class FI
Implements IDisposable
<MessageHeader(MustUnderstand:=True)_
Public id as Integer
<MessageHeader(MustUnderstand:=True)_
Public token as String
<MessageHeader(MustUnderstand:=True)_
Public length as Long
<MessageHeader(MustUnderstand:=True)_
Public del as Char
<MessageHeader(Order:=1)_
Public stream as System.IO.Stream`
Public Sub Dispose() Implements IDisposable.Dispose
FI.Close()
FI=Nothing
End Sub
End Class
在 VS 中配置服务并更新后在客户端出现多个错误:
1) 对于getResults:需要ArrayOfKeyValueOfstringstringKeyValueOfstringstring 而不是字典。我已经将操作合同声明为<OperationContract(), ServiceKnownType(GetType(Dictionary(Of String, String)))>,但没有成功。我的客户端设置是 CollectionType = Generic.List 和 DictionaryCollectionType = Generic.Dictionary。我也尝试删除并再次添加服务。
2) 对于FI:使用MessageContract FI 的方法签名要求参数del 为整数类型。在这里我不知道该怎么办。
我必须补充一点,直到最近一切正常,我记得的唯一变化是将 Visual Studio 从 2010 年更新到 2012 年。
【问题讨论】:
标签: vb.net wcf dictionary