My WCF service looks like this:
http://localhost:4249/TestService.svc
I tried this:
[ServiceContract]
public interface ITestService
{
[OperationContract]
[WebGet(UriTemplate = "/GetAllPersons", ResponseFormat = WebMessageFormat.Xml)]
ListGetAllPersons();
public class TestService: ITestService
{
public ListGetAllPersons()
{
return Employees.CreateEmployees();
}
I tried this in the address bar of the browser:< /p>
http://localhost:4249/TestService/GetAllPersons
However, I have the following error:
< blockquote>
Server Error in’/’ Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make
sure that it is spelled correctly.
Requested URL: /TestService/GetAllPersons
What did I do wrong?
This is my web.config file, you can view:
< /pre>
< assemblies>
< br />
< br />
< br />
< serviceBehaviors>
bindingConfiguration="WHB" contract="" />
< /services>
I just want to know how to call WCF services through the browser (Firefox)?
My WCF service looks like this:
http://localhost:4249/TestService.svc
I tried this:
[ServiceContract]
public interface ITestService
{
[OperationContract]
[WebGet(UriTemplate = "/GetAllPersons", ResponseFormat = WebMessageFormat.Xml)]
ListGetAllPersons();
public class TestService: ITestService
{
public ListGetAllPersons()
{
return Employees.CreateEmployees();
}
I tried this in the address bar of the browser:< /p>
http://localhost:4249/TestService/GetAllPersons
However, I have the following error:
< blockquote>
Server Error in'/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make
sure that it is spelled correctly.
Requested URL: /TestServ ice/GetAllPersons
What did I do wrong?
This is my web.config file, you can view:
< /pre>
< br />
< br />
< serviceBehaviors>
In addition to the factory changes mentioned in the comments above, you also need to enable webHttpBinding in web.config. Use this as a template, from the existing web. config copy contract and name details:
< br />
bindingConfiguration="WHB" contract="" />