views:

209

answers:

1

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.

+1  A: 

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>
Ray Vernagus
that works fine for utf-8 and utf-16 - but if you need to use e.g. ISO-8859-1 (ISO Western European), you're out of luck. You have to write your own custom text encoder (which is fairly easy to do) and plug it into WCF as an extension.
marc_s
We are not using WCF right now, but if it's the only way to do it we might switch to it.Still, we'd prefer a solution that will work with asmx web services.
David Thibault