# ActionWebService and namespaces

**URL:** <https://www.ruby-forum.com/t/actionwebservice-and-namespaces/57165>\
**Category:** Rails\
**Created:** [April 7, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/actionwebservice-and-namespaces/57165 "2006-04-07T17:01:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Stadig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@Paul\_Stadig](https://www.ruby-forum.com/u/Paul_Stadig)\
**Post date:** [April 7, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/actionwebservice-and-namespaces/57165/1 "2006-04-07T17:01:49Z")

</div>

Hi all,  
I’ve tried to search the mailing list, web, etc. and haven’t found  
anything that seems to answer my question.

I have a WSDL for a web service written in Java, and I’m trying to  
consume it in ruby using ActionWebService. I’ve created my API and some  
struct classes. I’ve found the :namespace option to  
ActionWebService::Client::Soap.new, but when I try to invoke an action  
on the web service I get the following error:

: No Deserializer found to deserialize a  
‘urn:rocis-ws-pra-service-IROCIS\_PRA\_WS:Rocis\_ws\_pra\_service\_ROCISSecurityBean’  
using encoding style ‘[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)’.  
[java.lang.IllegalArgumentException] (SOAP::FaultError)

From what I gather, this means that my namespaces and element names  
(i.e. class names) are not matching up with those declared in the WSDL  
file. There are two problems:

1. The WSDL uses multiple namespaces (one for the SOAP action  
declarations and one for the schema declarations for the input/output of  
those actions, and some others), and I’m not sure which one I should be  
sending to the :namespace option. I’ve tried all of them in turn. My  
impression is that AWS expects the whole WSDL to use a single namespace  
for declaration of actions, data, etc.

2. The XML element that I’m trying to send is actually  
“rocis\_ws\_pra\_service\_ROCISSecurityBean”, but in ruby, classes must be  
capitalized so it’s getting sent that way.

One of both of these could be contributing to my problem. Is there a  
way to declare an ActionWebService::Struct and tell it to use a specific  
namespace and element name when it is marshalled? Or can I somehow  
convince ruby to allow me to declare a class with a name that starts  
with a lowercase letter?

I’m not sure I can send the WSDL file, but if more information is needed  
I can try to duplicate the problem with a clean room WSDL.

TIA,  
Paul Stadig

---

<div class="post-metadata">

**Author:** ![Paul\_Stadig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@Paul\_Stadig](https://www.ruby-forum.com/u/Paul_Stadig)\
**Post date:** [April 7, 2006, 5:13pm UTC](https://www.ruby-forum.com/t/actionwebservice-and-namespaces/57165/2 "2006-04-07T17:13:26Z")

</div>

ActionWebService::Client::Soap is not a general-purpose client. If you  
need  
a interoperability with other SOAP frameworks, you are better of using  
soap4r directly.

## – Kent

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries

---

<div class="post-metadata">

**Author:** ![Paul\_Stadig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5fc32e/32.png) [@Paul\_Stadig](https://www.ruby-forum.com/u/Paul_Stadig)\
**Post date:** [April 7, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/actionwebservice-and-namespaces/57165/3 "2006-04-07T17:25:50Z")

</div>

Thanks for the reply. I was able to get it to work with soap4r, though  
I had a bit of trouble figuring out how to use the wsdl2ruby script.

Paul Stadig
