How to call WCF services through your browser (Firefox)?

I just want to know how to call WCF service 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)]
List GetAllPersons();


public class TestService: ITestService
{
public List GetAllPersons()
{
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:




















< assemblies>








< br />






























< br />






< br />



< serviceBehaviors>









< /pre>
In addition to the factory changes mentioned in the comment above, webHttpBinding needs to be enabled in web.config .Use this as a template to copy the contract and name details from the existing web.config:




















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)]
List GetAllPersons();


public class TestService: ITestService
{
public List GetAllPersons()
{
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:




























































< br />






< br />



< serviceBehaviors>









< /pre>

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="" />

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4329 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.