调用/获取wcf服务时出错
我有这样的方法调用/获取wcf服务时出错,wcf,Wcf,我有这样的方法 <OperationContract()> <Web.WebGet(UriTemplate:="/GetBedTypeList?strErrMsg={strErrMsg}&chrErrFlg={chrErrFlg}&pcompanycode={pcompanycode}&pdiv={pdiv}&ploc={ploc}", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMe
<OperationContract()>
<Web.WebGet(UriTemplate:="/GetBedTypeList?strErrMsg={strErrMsg}&chrErrFlg={chrErrFlg}&pcompanycode={pcompanycode}&pdiv={pdiv}&ploc={ploc}", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Wrapped)> _
Function GetBedTypeList(ByRef strErrMsg As System.Collections.Generic.List(Of String), ByRef chrErrFlg As Char, _
ByVal pcompanycode As String,ByVal pdiv As Integer, _
ByVal ploc As Integer) As System.Collections.Generic.List(Of CWReadClasses.clsBedTypeMaster)
_
函数GetBedTypeList(ByRef strErrMsg作为System.Collections.Generic.List(字符串),ByRef Cherrflg作为Char_
ByVal pcompanycode作为字符串,ByVal pdiv作为整数_
ByVal ploc作为整数)作为System.Collections.Generic.List(属于CWReadClasses.clsBedTypeMaster)
但这是一个错误,请帮助
合约“iBedTypeMaster”中的操作“GetBedTypeList”具有名为“strErrMsg”的查询变量,其类型为“System.Collections.Generic.List
1[System.String]”,但类型“System.Collections.Generic.List
1[System.String]”不能由“QueryStringConverter”转换。UriTemplate查询值的变量必须具有可由“QueryStringConverter”转换的类型。根据错误说明,默认情况下,WCF不知道如何将查询字符串参数(字符串)转换为列表(字符串)
,该列表是strErrMsg
参数的类型。您可以将其更改为已知类型(字符串、数字、布尔值),也可以根据错误提示,向服务中添加QueryStringConverter
,以“教”它如何从查询字符串转换为该类型。有关查询字符串转换器的更多信息,请访问