David Thibault
David Thibault

Reputation: 8736

How to change the encoding of a web service in .Net?

We are developing a web service in .Net, and our client would like the responses of the service to be encoded in something other than UTF-8. Is it possible?

This page seems to indicate it is not possible, but I'd like a second opinion.

The service is an asmx webservice. We are considering switching to WCF if it's the only way to go, but we'd like to keep the effort required for this change to a minimum.

Upvotes: 1

Views: 4220

Answers (1)

Ray Vernagus
Ray Vernagus

Reputation: 6150

If you're using WCF (which you should be ;) ), then it's as easy as specifying the textEncoding type in your configuration:

<bindings>
  <basicHttpBinding>
    <binding name="MyWebBinding" textEncoding="utf-16" />
  </basicHttpBinding>
</bindings>

Upvotes: 2

Related Questions