# Calling ASP C# web service from Ruby?

**URL:** <https://www.ruby-forum.com/t/calling-asp-c-web-service-from-ruby/49389>\
**Category:** Ruby\
**Created:** [December 3, 2005, 8:29am UTC](https://www.ruby-forum.com/t/calling-asp-c-web-service-from-ruby/49389 "2005-12-03T08:29:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mmm](https://www.ruby-forum.com/u/mmm)\
**Post date:** [December 3, 2005, 8:29am UTC](https://www.ruby-forum.com/t/calling-asp-c-web-service-from-ruby/49389/1 "2005-12-03T08:29:20Z")

</div>

Hi, I’m new to Ruby and would appreciate some suggestions…I’m  
attempting to call a soap web service written in C# and hosted w/ IIS  
from Ruby.

Does anyone know of a simple code segment that actually does this? The  
AWS icd example that does this is giving lots of errors (c:/program  
files/ruby/lib/ruby/1.8/xsd/charset.rb:97:in `encoding\_conv’: Converter  
not found: UTF8 → SJIS (XSD::Charset::CharsetConversionError) which I  
do not understand and can’t figure out how to resolve…

## The code i’ve tried so far looks like this:

class GPSLog \< ActionWebService::API::Base  
inflect\_names false  
api\_method :RetrLastPosition,  
:expects =\> [:int],  
:returns =\> [:int]  
end

```
soap_client =

```

## ActionWebService::Client::Soap.new(GPSLog,“[http://localhost/WebService/GPSLog/GPSLog.asmx](http://localhost/WebService/GPSLog/GPSLog.asmx)”) ret = soap\_client.RetrLastPosition(11);

The error I’m getting back from the ASP server is: The request element  
\<RetrLastPosition xmlns=‘urn:ActionWebService’\> was not  
recognized."

…w/ a sc-status error of 500 from IIS.

As I’m new to this it seems there are a zillion things I could be doing  
wrong so a working example would be really great or if some can point  
me in the right direction it will be greatly appreciated, thanks, mmm

---

<div class="post-metadata">

**Author:** ![mmm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mmm](https://www.ruby-forum.com/u/mmm)\
**Post date:** [December 3, 2005, 8:27pm UTC](https://www.ruby-forum.com/t/calling-asp-c-web-service-from-ruby/49389/2 "2005-12-03T20:27:40Z")

</div>

On Saturday 03 December 2005 04:27 pm, mmm wrote:

> ```
> soap_client =
> 
> ```
> 
> ## ActionWebService::Client::Soap.new(GPSLog,“[http://localhost/WebService/GPSL](http://localhost/WebService/GPSL) og/GPSLog.asmx”) ret = soap\_client.RetrLastPosition(11);
> 
> The error I’m getting back from the ASP server is: The request element  
> \<RetrLastPosition xmlns=‘urn:ActionWebService’\> was not  
> recognized."

Remember, theres a certain company who likes to break every standard in  
the  
book. Please try…

soap\_client.default\_encodingstyle =  
SOAP::EncodingStyle::ASPDotNetHandler::Namespace

Tsume
