0

I have a webservice as below

   <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

And I am trying to fetch it as

http://BedTypeMasterService.svc/GetData?strErrMsg="ff"&chrErrFlg="dd"

But it is giving following error

Operation 'GetData' in contract 'iBedTypeMaster' has a query variable named 'strErrMsg' of type 'System.Collections.Generic.List1[System.String]', but type 'System.Collections.Generic.List1[System.String]' is not convertible by 'QueryStringConverter'. Variables for UriTemplate query values must have types that can be converted by 'QueryStringConverter'.

Please help me out to solve this

As per provided link i try like this

      <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>
Mayur
  • 79
  • 1
  • 2
  • 16
  • Why don't you use `Function GetData(ByRef strErrMsg As String, ByRef chrErrFlg As String) As String`? – Alex Filipovici Jul 22 '13 at 08:52
  • possible duplicate of [In WCF web programming model, how can one write a operation contract with an array of query string parameters (i.e. with the same name)?](http://stackoverflow.com/questions/354727/in-wcf-web-programming-model-how-can-one-write-a-operation-contract-with-an-arr) – Alex Filipovici Jul 22 '13 at 09:23
  • Please find my updated answer I did as suggested in link but some other problems are occuring – Mayur Jul 23 '13 at 05:28
  • Error Is Invalid element in configuration. The extension 'customWebHttp' does not derive from correct extension base type 'System.ServiceModel.Configuration.BehaviorExtensionElement'. – Mayur Jul 23 '13 at 05:37

0 Answers0