I have web service like the following
[ServiceContract][ServiceKnownType(typeof(test))]interfaceItestbService{[OperationContract]IList<test>RetrieveTestList();}publicclassTestWebService:ItestbService{[WebInvoke(UriTemplate="RetrieveTestList",Method="GET",ResponseFormat=WebMessageFormat.Json,RequestFormat=WebMessageFormat.Json)]publicIList<test>RetrieveTestList(){returnnew test().ListOftests();}
then in separate project I hosted it using the following code using svc file using the following line
<%@ServiceHostLanguage="C#"Debug="true"Service="test.WebService.TestWebService"CodeBehind="test.WebService.TestWebService.cs"%>
and this is the web.config
<system.serviceModel><services><servicename="test.WebService.TestWebService"><endpointaddress=""binding="webHttpBinding"contract="test.WebService.ItestbService"behaviorConfiguration="web"></endpoint></service></services><behaviors><endpointBehaviors><behaviorname="web"><webHttp/><dataContractSerializermaxItemsInObjectGraph="2147483647"/></behavior></endpointBehaviors><serviceBehaviors><behavior><dataContractSerializermaxItemsInObjectGraph="2147483647"/><serviceMetadatahttpGetEnabled="true"/><serviceDebugincludeExceptionDetailInFaults="true"/></behavior></serviceBehaviors></behaviors><bindings><webHttpBinding><bindingname="defaultRest"><readerQuotasmaxStringContentLength="2147483647"maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxDepth="64"maxNameTableCharCount="2147483647"/><securitymode="None"/></binding></webHttpBinding></bindings><serviceHostingEnvironmentmultipleSiteBindingsEnabled="true"/></system.serviceModel>
put when call in the browser the method it give bad request