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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:57:54+00:00 2026-05-18T02:57:54+00:00

Possible Duplicate: Calling a webservice that uses ISO-8859-1 encoding from WCF I am trying

  • 0

Possible Duplicate:
Calling a webservice that uses ISO-8859-1 encoding from WCF

I am trying to consume an external Web Service (the web service has PHP implementation) using VS 2008, .net 3.5, WCF( Environment : Windows XP and VS 2008). I add Service Reference to Web Service, VS generates WCF Proxy.

Binding is basicHttpBinding.

I call to method in Web Service, using Proxy, then I started getting a ProtocolException, I received the following error message :

System.ServiceModel.ProtocolException:
The content type text/xml;
charset=ISO-8859-1 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 644 bytes of the response were:

This was successful

Well, I needed to call a service in iso-8859-1 encoding.

Any useful sample source code for solve it?

Update:

The default encoder used in WCF only works with UTF-8 and UTF-16 (big and little endian).

If I use textEncoding=”iso-8859-1″ in binding in app.config,

I get this error:

System.ArgumentException: No se admite
la codificación de texto ‘iso-8859-1’
usada en el formato de mensaje de
texto. Nombre del parámetro: encoding.

System.ServiceModel.Channels.TextEncoderDefaults.ValidateEncoding(Encoding
encoding)
System.ServiceModel.Channels.TextMessageEncodingBindingElement.set_WriteEncoding(Encoding
value)
System.ServiceModel.BasicHttpBinding.set_TextEncoding(Encoding
value)
System.ServiceModel.Configuration.BasicHttpBindingElement.OnApplyConfiguration(Binding
binding)
System.ServiceModel.Configuration.StandardBindingElement.ApplyConfiguration(Binding
binding)
System.ServiceModel.Description.ConfigLoader.LookupBinding(String
bindingSectionName, String
configurationName, ContextInformation
context)
System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint
serviceEndpoint, String
configurationName)
System.ServiceModel.ChannelFactory.ApplyConfiguration(String
configurationName)
System.ServiceModel.ChannelFactory.InitializeEndpoint(String
configurationName, EndpointAddress
address) ctor(String
endpointConfigurationName,
EndpointAddress remoteAddress)
CreateSimplexFactory()
CreateChannelFactory()
CreateChannelFactoryRef(EndpointTrait`1
endpointTrait)
InitializeChannelFactoryRef() ctor()
IntegracionEasyVista.ServiceEasyVista.WebServicePortTypeClient..ctor()
in

Update:

Calling a web service that uses ISO-8859-1 encoding from WCF

Calling a webservice that uses ISO-8859-1 encoding from WCF

This MSDN page (http://msdn.microsoft.com/en-us/library/ms751486(v=VS.90).aspx) shows how to create a “CustomTextEncoder” which can support more than utf-8, utf-16 and unicode encodings. It includes full sample source code and was very useful for me to get things going.

I use CustomTextMessageEncodingElement, but I get error:

The content type text/xml; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml;charset=iso-8859-1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:**

From code of Samples MSDN, I modify the constructor from CustomTextMessageEncoder class:

public CustomTextMessageEncoder(CustomTextMessageEncoderFactory factory)
{
    writerSettings = new XmlWriterSettings();
    writerSettings.Encoding = Encoding.GetEncoding(factory.CharSet);
    contentType = string.Format("{0};charset={1}", 
    factory.MediaType, this.writerSettings.Encoding.HeaderName);
}

I replace “{0};charset={1}” by “{0}; charset={1}” (I have included an blank)

Then, I get the error:

The message version of the outgoing message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/) AddressingNone
(http://schemas.microsoft.com/ws/2005/05/addressing/none)) does not match that of the encoder

(Soap12 (http://www.w3.org/2003/05/soap-envelope) Addressing10 (http://www.w3.org/2005/08/addressing)).
Make sure the binding is configured with the same version as the message.

  • 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-18T02:57:55+00:00Added an answer on May 18, 2026 at 2:57 am

    Does this existing answer help? Calling a webservice that uses ISO-8859-1 encoding from WCF

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

Sidebar

Related Questions

Possible Duplicate: calling ASP function from javascript okay running this code : <script type=text/javascript>
Possible Duplicate: Calling Python from Objective-C I'm a long-time Python programmer and short-time Cocoa
Possible Duplicate: Calling Python from JavaScript I have a test.py and test.js . I
Possible Duplicate: Calling NSLog from C++: “Format string is not a string literal (potentially
Possible Duplicate: C++ virtual function from constructor Calling virtual functions inside constructors This question
Possible Duplicate: Calling camera from an activity, capturing an image and uploading to a
Possible Duplicate: Retrieving the calling method name from within a method (C#) I have
Possible Duplicate: Opening the Settings app from another app I am calling: [[UIApplication sharedApplication]
Possible Duplicate: Remove from the array elements that are repeated. in Ruby I would
Possible Duplicate: How to format a JSON date? I am calling a JSON web

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.