# SOAP Problem with Non-ASCII Characters

**URL:** <https://www.ruby-forum.com/t/soap-problem-with-non-ascii-characters/48783>\
**Category:** Ruby\
**Created:** [November 24, 2005, 5:22pm UTC](https://www.ruby-forum.com/t/soap-problem-with-non-ascii-characters/48783 "2005-11-24T17:22:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![achim.domma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@achim.domma](https://www.ruby-forum.com/u/achim.domma)\
**Post date:** [November 24, 2005, 5:22pm UTC](https://www.ruby-forum.com/t/soap-problem-with-non-ascii-characters/48783/1 "2005-11-24T17:22:54Z")

</div>

Hi,

I use Ruby to access a .Net Webservice which returns german umlauts  
(äöü…). I create the service like this:

service = SOAP::RPC::Driver.new(server, InterfaceNS)  
service.default\_encodingstyle =  
SOAP::EncodingStyle::ASPDotNetHandler::Namespace

If there are umlauts in the result, I get the following error:

c:/ruby/lib/ruby/1.8/xsd/datatypes.rb:198:in `screen_data': {http://www.w3.org/2 001/XMLSchema}string: cannot accept '&#9500;ärzteblatt'. (XSD::ValueSpaceError) from c:/ruby/lib/ruby/1.8/xsd/datatypes.rb:140:in`set’  
from  
c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:473:in `deco de_textbuf' from c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:210:in`deco  
de\_tag\_end’  
from c:/ruby/lib/ruby/1.8/soap/parser.rb:191:in `decode_tag_end' from c:/ruby/lib/ruby/1.8/soap/parser.rb:152:in`end\_element’  
from c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:75:in  
`end_element' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:36:in`do\_parse’  
from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in  
`parse' ... 6 levels... from c:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:275:in`call’  
from c:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:302:in `search' from c:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:297:in`search’  
from C:/Sandbox/test\_NewsSearch.rb:25

Could somebody tell me how to fix this problem?

regards,  
Achim

---

<div class="post-metadata">

**Author:** ![achim.domma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@achim.domma](https://www.ruby-forum.com/u/achim.domma)\
**Post date:** [November 26, 2005, 5:37am UTC](https://www.ruby-forum.com/t/soap-problem-with-non-ascii-characters/48783/2 "2005-11-26T05:37:32Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

Achim D. (SyynX Solutions GmbH) wrote:

> I use Ruby to access a .Net Webservice which returns german umlauts  
> (äöü…). I create the service like this:
> 
> service = SOAP::RPC::Driver.new(server, InterfaceNS)  
> service.default\_encodingstyle =  
> SOAP::EncodingStyle::ASPDotNetHandler::Namespace
> 
> If there are umlauts in the result, I get the following error:

If your server allows UTF-8, whichever of these should work.

(1) pass -Ku argument to ruby interpreter such as ‘ruby -Ku myclient.rb’  
(2) add $KCODE = ‘UTF8’ at the top of the script.  
(3) set XSD::Charset.encoding = ‘UTF8’

Regards,  
// NaHi  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDh+Xbf6b33ts2dPkRAjuDAJ9vU8sb91++NrvrnMJqV1Cfw559TgCdE8CV  
XjuNy2qfliDHphu4tiAVyLw=  
=SCCj  
-----END PGP SIGNATURE-----
