Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
调用/获取wcf服务时出错_Wcf - Fatal编程技术网

调用/获取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
,以“教”它如何从查询字符串转换为该类型。有关查询字符串转换器的更多信息,请访问