我有一个网络服务,如下所示
<OperationContract()>
<Web.WebGet(UriTemplate:="/GetData?strErrMsg={strErrMsg}&chrErrFlg={chrErrFlg}", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Wrapped)> _
Function GetData(ByRef strErrMsg As System.Collections.Generic.List(Of String), ByRef chrErrFlg As String) As String
我正在尝试将其作为
获取http://BedTypeMasterService.svc/GetData?strErrMsg= “FF” &安培; chrErrFlg = “DD”
但是它给出了以下错误
合同'iBedTypeMaster'中的'GetData'操作有一个名为'strErrMsg'的查询变量,类型为'System.Collections.Generic.List 1[System.String]', but type 'System.Collections.Generic.List
1 [System.String]'不能由'QueryStringConverter'转换。 UriTemplate查询值的变量必须具有可由“QueryStringConverter”转换的类型。
请帮我解决这个问题
根据提供的链接,我尝试这样
<behaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<customWebHttp/>
</behavior>
</endpointBehaviors>
<extensions>
<behaviorExtensions>
<add name="customWebHttp" type="WcfServices.BedTypeMaster.bclsBedTypeMaster, WcfServices" />
</behaviorExtensions>
</extensions>
<service behaviorConfiguration="ServiceBehavior" name="WcfServices.BedTypeMaster.bclsBedTypeMaster">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="webHttpBindingWithJsonP" contract="WcfServices.BedTypeMaster.iBedTypeMaster"
behaviorConfiguration="webHttpBehavior">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange" />
</service>