Click here to Skip to main content
15,031,510 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
When I run My client application in Internet explorer, I got the output.

It called the service, but when I run the same client application in Google chrome and Firefox its getting 404 error.

Can you give some solution for the problem I am facing?



      <service name="WcfService3codepro.Service1" behaviorConfiguration="MyServiceBehaviour">
        <endpoint address="" binding="webHttpBinding" contract="WcfService3codepro.IService1" behaviorConfiguration="MyEndpointBehavior" />

        <behavior name="MyServiceBehaviour">
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />

        <behavior name="MyEndpointBehavior">
          <webHttp />
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <modules runAllManagedModulesForAllRequests="true" />
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
    <directoryBrowse enabled="true" />
                <add value="Service1.svc" />



      [WebInvoke(Method = "*", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
      string MyFunction(string Count);
      // TODO: Add your service operations here

    = AspNetCompatibilityRequirementsMode.Allowed)]
   public class Service1 : IService1
       public string MyFunction(string Count)
           return "The Name you passed  is: " + Count.ToString();


client jquery code
<head runat="server">
    <script src="Scripts/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" lang="ja">
        var counter = "karthik";

        function CallMyService() {
                type: "POST",
                url: "http://localhost/WcfService3codepro/Service1.svc/MyFunction",
                data: '{"Count": "' + counter + '"}',
                contentType: "application/json",
                success: ServiceSucceeded,
                error: ServiceFailed
        function ServiceFailed(result) {

            Log('Service call failed: ' + result.status + '  ' + result.statusText);
        function ServiceSucceeded(result) {
            var resultObject = result.MyFunctionResult;
            Log("Success: " + resultObject);

        function Log(msg) {
            $("#logdiv").append(msg + "<br />");


    <form id="form1" runat="server">
     <input id="Button1" type="button" value="Execute" onclick="CallMyService();" />
    <div id="logdiv"></div>
        <asp:Label ID="lblmsg" runat="server" />
Updated 1-Nov-13 1:55am
Very less info. Please post the codes and try to explain what you want to achieve.
Prasad Khandekar 1-Nov-13 3:58am
Hello Karthik,

Perhaps this article can provide you some help. (


I was getting the same problem just 15 days before.
And i googled it so much and found that it may work if i hosted it on IIS server.
try hosting that in IIS and check what happens.

And check the request header the request header might sending request with OPTION method instead of GET/POST.Try to explore on that also.
change your contract method to

Hope This Helps You.
Pratik Bhuva
karthik mushyam 1-Nov-13 7:17am
i tried it but no solution
Pratik Bhuva 1-Nov-13 9:01am
Have you Hosted on IIS???
karthik mushyam 3-Nov-13 23:33pm
ya i have Hosted ...sorry for the delay ..
This problem also same behaves like below url. which question is posted by you

calling wcf service Endpoint not found[^]

please check your answer given link

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900