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 8604993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:42:52+00:00 2026-06-12T02:42:52+00:00

I am struggeling with a problem with WCF Service configuration. I have following config:

  • 0

I am struggeling with a problem with WCF Service configuration.
I have following config:

<behaviors>
  <serviceBehaviors>
    <behavior name="SampleWebBehavior">
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
    <behavior name="MyServiceTypeBehaviors">
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
  <add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false"/>

It works perfectly, I can try the methods with WcfTestClient.exe and get correct responses. But I need the binding to be webHttpBinding, so I can see the results in browser and create JSON requests and responses.
But when I change the binding to webHttpBinding, it throws an error:

The message with Action ” cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Thaks for any help.

  • 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-06-12T02:42:53+00:00Added an answer on June 12, 2026 at 2:42 am

    To pull this off you need to do a few things in your config

    1) add another endpoint to your service, you can see below I have both basicHttp and webHttp

        <system.serviceModel>
            <services>
              <service name="<serivceclass>" behaviorConfiguration="DefaultBehavior">
                <endpoint binding="basicHttpBinding" contract="<serviceinterface>" bindingConfiguration="soapBinding"/>
                <endpoint address="json" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="<serviceinterface>" bindingConfiguration="jsonBinding"/>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
              </service>
     </system.serviceModel>
    

    2) add your binding config (again you’ll see both web and basichttp)

    <system.serviceModel>
    <bindings>
          <basicHttpBinding>
            <binding name="soapBinding" maxBufferPoolSize="9000000" maxBufferSize="9000000" maxReceivedMessageSize="9000000">
              <readerQuotas maxArrayLength="9000000" maxBytesPerRead="9000000" maxDepth="9000000" maxNameTableCharCount="9000000" maxStringContentLength="9000000"/>
              <security mode="None">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <binding name="jsonBinding">
              <security mode="None">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </webHttpBinding>
        </bindings>   
      </system.serviceModel>
    

    3) Setup your behaviors – notice the names and how they correlate tot the endpoints listed in step 1

    <system.serviceModel>    
    <behaviors>
              <endpointBehaviors>
                <behavior name="jsonBehavior">
                  <webHttp defaultOutgoingResponseFormat="Json" />
                </behavior>
              </endpointBehaviors>
              <serviceBehaviors>
                <behavior name="DefaultBehavior">
                  <serviceMetadata httpGetEnabled="true" />
                  <serviceDebug includeExceptionDetailInFaults="true" />
                  <dataContractSerializer maxItemsInObjectGraph="9000000" />
                </behavior>
              </serviceBehaviors>
            </behaviors>
    </system.serviceModel>
    

    While some of the stuff I enable and config are optional this allows you to access the service both ways, one way using web and json stuff and another using the tooling built into visual studio when you are not working in javascript,etc.

    Note1: the endpoint when you are using the json part will be for example http://myhost.com/myservice.svc/json/MyMethodName, You can change this by modifying the “address” attribute on the appropriate endpoint line for your service (see how basic address is empty and the webHttp is ‘json’)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem i am struggling to create a WCF Service Application form
I been struggeling with this problem for two days now and have still not
I have a problem I've been struggeling with for a full week now, and
I'm new to Hibernate and I'm struggling with problem: I have 3 tables and
I am struggling with a problem in assembly, where I have to take the
In my test project, I created a WCF service and got it running. Next,
I need some help posting some XML to a WCF service. In essence, the
I am struggeling with a query. I have two tables: CREATE TABLE Playlist( id
I've been struggling with this problem for 5 hours and I have a feeling
I have been struggling with a problem that only happens when the database has

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.