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

  • Home
  • SEARCH
  • 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 3662344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:24:22+00:00 2026-05-19T01:24:22+00:00

I have my WCF service, I’ve created reference to it from MSTest project. Here

  • 0

I have my WCF service, I’ve created reference to it from MSTest project. Here is example how I am calling service methods:

IEnrollmentService serviceClient = ChannelFactory<IEnrollmentService>
    .CreateChannel(new BasicHttpBinding(),
                   new EndpointAddress("http://localhost/EnrollmentService.svc"));

PublishResult res = serviceClient.PublishEnrollmentProfile(...);

Instead of execution I’ve got the following error:

The content type application/xml;
charset=utf-8 of the response message
does not match the content type of the
binding (text/xml; charset=utf-8). If
using a custom encoder, be sure that
the IsContentTypeSupported method is
implemented properly. The first 710
bytes of the response were: ‘Sendera:ActionNotSupportedThe 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).’. —>
System.Net.WebException: The remote
server returned an error: (500)
Internal Server Error..

As far as I understood, there are some issues between ContractFilter and EndpointDispatcher. I’ve tried to goodgle, but found nothing understandable…

I’ve also tried to call wcf service methods in another way:

EnrollmentServiceClient serviceClient = new EnrollmentServiceClient("http://localhost/EnrollmentService.svc");

PublishResult res = serviceClient.PublishEnrollmentProfile(...);

That returns me another error:

Could not find endpoint element with
name
‘http://localhost/McActivation/EnrollmentService.svc‘
and contract
‘EnrollmentServiceReference.IEnrollmentService’
in the ServiceModel client
configuration section. This might be
because no configuration file was
found for your application, or because
no endpoint element matching this name
could be found in the client element..

Question1:

What is a correct way to instantiate wcf service client?

Questions2:

What is wrong in my case?

Thanks a lot.

P.S. With some issues I can connect to service with WcfTestClient, more details are here:
WCF service: Can't call methods through the 'WebHttpBinding' endpoint

P.P.S. Here is server side WCF service configuration:

<system.serviceModel>
<services>
  <service name="McActivationApp.EnrollmentService" behaviorConfiguration="McActivationApp.EnrollmentServicBehavior">
    <endpoint address="" binding="webHttpBinding" contract="McActivationApp.IEnrollmentService"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="McActivationApp.IEnrollmentService" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="McActivationApp.EnrollmentServicBehavior">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
  • 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-19T01:24:22+00:00Added an answer on May 19, 2026 at 1:24 am

    Your problem is this: your service config defines a webHttpBinding endpoints – that’s a REST (“Xml-over-HTTP”) endpoint….

    Yet, your client uses a basicHttpBinding and this is a SOAP binding – those are not compatible!

    You need to change this to make sure the service endpoint(s) offered by the service side are such that the client can connect to it.

    So:

    • either add another endpoint to your service config with the basicHttpBinding and connect to that endpoint

    or:

    • change your client side to use webHttpBinding
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service that I have to reference from a .net 2.0
I have a WCF service hosted for internal clients - we have control of
I have a WCF service and I want to expose it as both a
I have a WCF service running on the IIS with a ServiceHostFactory. It's running
I have a WCF service, hosted in IIS 7.0 that needs to run database
I have a WCF service with the following configuration: <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=MetadataEnabled>
I have a WCF Service that should not enter the faulted state. If there's
I have a WCF service which will be hosted under IIS. Now I have
I have a WCF service that is hosted in a windows application. The service
I have a WCF Service that exposes a method GetCustomers(). The internals of the

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.