• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

C# Web Service

I have a console application in Visual Studio 2012. The console is supposed to run a web service that moves data between databases. When I run it, it appears to work until it gets to the web service. Once it tries to connect, it errors out. This is some of the error I get:
Error: The content type application/xml; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)

Any ideas what I am missing or am doing wrong?
  • 2
1 Solution
Are you getting some kind of error message from the WebService page itself?
What if you try to open that page in Internet Explorer?
Bob LearnedCommented:
What type of web service are you working with, and how did you add a reference to the web service?
Monica PSoftware DeveloperCommented:

the client expects a SOAP XML message (content type: application/soap+xml; charset=utf-8), the server-side endpoint is a REST endpoint which returns plain XML (content type: application/xml; charset=utf-8)

Make sure both the client and the server endpoint used are in sync with regards to bindings and configuration!

Try to make binding"  service with the service behaviour
        <behavior name="YourBehaviourNameHere">
                      ----set of tags goes here


     <service name="WCFservice behaviourConfiguration="YourBehaviourNameHere">
              ----set of tags goes here
Monica PSoftware DeveloperCommented:
To fix install the WCF non-HTTP activation components

Click the Start button, and then click Control Panel.

Click Programs, and then click Programs and Features.

On the Tasks menu, click Turn Windows features on or off.

Find the .NET Framework 3.0 node, select and then expand it.

Select the WCF Non-Http Activation Components box and save the setting.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now