Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:36:07+00:00 2026-05-24T12:36:07+00:00

I hate WCF setup with endpoints, behaviors etc. I believe all these things should

  • 0

I hate WCF setup with endpoints, behaviors etc. I believe all these things should be performed automatically. All I want to do is to return JSON result from my WCF service. Here is my configuration:

<system.serviceModel>
<bindings>
  <webHttpBinding>
    <binding name="default"/>
  </webHttpBinding>
</bindings>
<services>
  <service name="HighOnCodingWebApps.ZombieService"
     behaviorConfiguration="MyServiceTypeBehaviors">
    <endpoint address="" binding="webHttpBinding"
      bindingConfiguration="default"
      contract="HighOnCodingWebApps.IZombieService"
      behaviorConfiguration="webScriptEnablingBehavior"/>
  </service>
</services>

<behaviors>
  <endpointBehaviors>
    <behavior name="webScriptEnablingBehavior">
      <enableWebScript/>
    </behavior>
  </endpointBehaviors>

  <serviceBehaviors>
    <behavior name="MyServiceTypeBehaviors">
      <serviceMetadata httpGetEnabled="true"/>


    </behavior>
  </serviceBehaviors>
</behaviors>

<serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>

And I have the following service implementation:

public class ZombieService : IZombieService
    {
        [WebInvoke(Method = "GET",
                    ResponseFormat = WebMessageFormat.Json,
                    UriTemplate = "KnownZombies")]
        public Zombie GetZombie()
        {
           return new Zombie() { Name = "Mohammad Azam"};
        }
    }

    public class Zombie
    {
        public string Name { get; set; }
    }

When I visit http://localhost:22059/ZombieService/KnownZombies says the following message:

Endpoints using ‘UriTemplate’ cannot be used with ‘System.ServiceModel.Description.WebScriptEnablingBehavior’.

If I remove the WebScriptEnablingBehavior from the web.config I get the following error:

The message with To
‘http://localhost:22059/ZombieService.svc/KnownZombies&#8217; cannot be
processed at the receiver, due to an AddressFilter mismatch at the
EndpointDispatcher. Check that the sender and receiver’s
EndpointAddresses agree.

UPDATE 1:

I updated the configuration to this:

 <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="default"/>
      </webHttpBinding>
    </bindings>
    <services>
      <service name="HighOnCodingWebApps.ZombieService"
         behaviorConfiguration="MyServiceTypeBehaviors">
        <endpoint address="http://localhost:22059/ZombieService.svc" binding="webHttpBinding"
          bindingConfiguration="default"
          contract="HighOnCodingWebApps.IZombieService"
          />
      </service>
    </services>

    <behaviors>
      <endpointBehaviors>
        <behavior name="SomeBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors">

          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

  </system.serviceModel>

Now when I visit http://localhost:22059/ZombieService.svc/KnownZombies I get the following message in the browser:

The message with To
‘http://localhost:22059/ZombieService.svc/KnownZombies&#8217; cannot be
processed at the receiver, due to an AddressFilter mismatch at the
EndpointDispatcher. Check that the sender and receiver’s
EndpointAddresses agree.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:36:07+00:00Added an answer on May 24, 2026 at 12:36 pm

    Take a look at this SO question.

    Edit: Since you’re not specifying an address for your service, try hitting: http://localhost:22059/ZombieService.svc/KnownZombies (with the .svc).

    I also think you need the <webHttp /> behavior added to your specified endpoint behavior.

    Edit: Try changing your endpoint definition to this:

    <service 
      name="HighOnCodingWebApps.ZombieService"
      behaviorConfiguration="MyServiceTypeBehaviors">
    
      <endpoint 
        address="" 
        binding="webHttpBinding"
        behaviorConfiguration="SomeBehavior"
        bindingConfiguration="default"
        contract="HighOnCodingWebApps.IZombieService" />
    
    </service>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hate generating an exception for things that I can simply test with an
I hate these three tables that. Two tables have a many to many relationship
I hate CURL it is too bulky with too many dependencies when all I
I hate how .NET Programs want you to download the .NET Framework to run
I hate using these because I can never find a tutorial for them. I
I hate IE, I only want to display an out-of-date browser notification to IE8
i hate asking for help as i would rather figure things for myself, or
I hate to ask these type of questions but I am in a bind
Just personal style, I guess, but I hate having 2 files for my WCF
I hate case sensitivity in databases, but I'm developing for a client who uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.