When I do return Employee
class works fine but what I need only couple properties so I am trying to make it work like this which gets ERR_CONNECTION_REFUSED
on browser but no error on code behind.
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "employees")]
public object GetEmployees()
{
var c = Employee.GetList().Select(x => new { id = x.Id, title = x.Title, person = x.FullName});
return c;
}
[OperationContract]
object GetEmployees();
WebConfig
<service name="FOO.FOO.FOOService">
<endpoint address="http://localhost:8733/FOOService" binding="webHttpBinding" contract="FOO.FOO.IFOOService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/FOOService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior>
<webHttp />
</behavior>
</endpointBehaviors>