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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:04:05+00:00 2026-05-26T02:04:05+00:00

I have a very basic webservice using WCF (C#, .NET 4.0), to return an

  • 0

I have a very basic webservice using WCF (C#, .NET 4.0), to return an hello message.

The deployment under IIS 7 and running it is ok, but when I do svcutil.exe http://localhost:4569/Service.svc?wsdl through the CMD to test the webservice I get:

the remote server returned an error: 415 cannot proccess the message
because the content type ‘aplication/soap+xml charset=utf8’ was not
the expected type ‘text/xml charset=utf8’

When trying to add the service reference (to create a client) I get

An existing connection was forcibly closed by the remote host Metadata
contains a reference that cannot be resolved:
‘http://localhost:4569/Service.svc’. Content Type
application/soap+xml; charset=utf-8 was not supported by service
http://localhost:4569/Service.svc. The client and service bindings
may be mismatched. The remote server returned an error: (415) Cannot
process the message because the content type ‘application/soap+xml;
charset=utf-8’ was not the expected type ‘text/xml; charset=utf-8’..

I’m pretty sure that the problem is under my Web.config file:

    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
<services>
         <service name="Service">
             <endpoint name="soap" 
                 address="http://localhost:4569/Service.svc" 
                 binding="basicHttpBinding" 
                 contract="IService" />
             <endpoint name="mex" address="mex" binding="mexHttpBinding" 
                       contract="IMetadataExchange" />
         </service>
         <behaviors>
            <serviceBehaviors>
               <behavior>
                  <serviceMetadata httpGetEnabled="true"/>
                  <serviceDebug includeExceptionDetailInFaults="false"/>
               </behavior>
            </serviceBehaviors>
</services>
         </behaviors>
         <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    </configuration>

Anyway, here’s my code:

IService.cs:

[ServiceContract]
public interface IService
{
    [OperationContract]
    string getMessage();
}

My service.cs has the method

public class Service : IService
{
    public string getMessage()
    {
        return "Ola servico";
    }
}

I really don’t know what is happening, did some tests after some research but no success.

Service.svc

<%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" %>        
  • 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-26T02:04:06+00:00Added an answer on May 26, 2026 at 2:04 am

    You have no service and endpoint defined in your config. Try adding

    <services>
      <service name="Service"> <!-- name should match the name in your .svc file (if you open it with a text editor) -->
        <endpoint name="soap" address="" binding="basicHttpBinding" contract="IService" />
        <endpoint name="mex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very basic semaphore code that works great on Linux, but cannot
I have very basic question regarding return value of a function, and checking the
I have a very basic email submission form in my ASP.NET MVC 3 app.
I have a very basic LEFT OUTER JOIN to return all results from the
I have a very basic doubt regarding the method that gets executed when app
I have a very basic knowledge of the web programming, and I couldn't figure
I have a very basic texture map problem in GL on iPhone, and I'm
I have a very basic data class that is subclassed from NSObject. I declare
I have a very basic query string which passes a ID to a receiving
Well, I think I have a very basic doubt here: I'm developing an app

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.