# SOAP error: Cannot map \<class\> to SOAP/OM

**URL:** <https://www.ruby-forum.com/t/soap-error-cannot-map-class-to-soap-om/182773>\
**Category:** Ruby\
**Created:** [February 2, 2010, 5:23pm UTC](https://www.ruby-forum.com/t/soap-error-cannot-map-class-to-soap-om/182773 "2010-02-02T17:23:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [February 2, 2010, 5:23pm UTC](https://www.ruby-forum.com/t/soap-error-cannot-map-class-to-soap-om/182773/1 "2010-02-02T17:23:45Z")

</div>

Hi,

Ruby 1.8.7  
soap 1.5.8  
Linux & Mac

I’m getting an odd error from the soap library while attempting to  
connect to a Sympa 5 server in one of our production apps:

A SOAP::Mapping::MappingError occurred in mail\_list#display\_list:

Cannot map Array to SOAP/OM.  
[RAILS\_ROOT]/vendor/gems/soap4r-1.5.8/lib/soap/mapping/  
encodedregistry.rb:356:in `\_obj2soap’

The line in question is this:

soap = @stub.authenticateAndRun(@email, @connection, ‘lists’, [nil])

Here @stub is the SOAP::RPC::Driver object, @email is the postmaster’s  
email address, and @connection is the result of @stub.login.

Replacing [nil] with just nil doesn’t work either. Then it complains  
that it cannot map NilClass to SOAP/OM.

What’s odd is that I can’t duplicate this with a standalone program,  
and it seems to work fine on our preview boxes. It’s only on our  
production boxes that this occurs.

Here’s a standalone script that works fine, and simulates what we’re  
doing:

require ‘soap/rpc/driver’

server = ‘[http://our.sympa.com/sympasoap](http://our.sympa.com/sympasoap)’  
email = ‘removed\_email\_address@domain.invalid’  
passwd = ‘XXXXXX’  
nspace = ‘urn:sympasoap’

soap = SOAP::RPC::Driver.new(server, nspace)

soap.add\_method(‘login’, ‘email’, ‘password’)  
soap.add\_method  
(‘authenticateAndRun’,‘email’,‘cookie’,‘service’,‘parameters’)  
cookie = soap.login(email, passwd)

# Get all lists

p soap.authenticateAndRun(email, cookie, ‘lists’, nil)

# Get test list

p soap.authenticateAndRun(email, cookie, ‘lists’, ‘testlist’)

Any ideas what could be causing this?

Regards,

Dan

For more on Sympa:

> **[index \[Sympa mailing list server\]](https://www.sympa.org/)**
>
> The site for Sympa has moved!
