# Soap complex type seen as nil

**URL:** <https://www.ruby-forum.com/t/soap-complex-type-seen-as-nil/85022>\
**Category:** Ruby\
**Created:** [February 9, 2007, 11:00am UTC](https://www.ruby-forum.com/t/soap-complex-type-seen-as-nil/85022 "2007-02-09T11:00:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [February 9, 2007, 11:00am UTC](https://www.ruby-forum.com/t/soap-complex-type-seen-as-nil/85022/1 "2007-02-09T11:00:32Z")

</div>

I can’t figure out how to pass a complex type to a soap call. I thought  
all you had to do was pass it as a hash, so I could do something like  
this:

result = driver.GetArticle(‘Request’ =\> {‘ArticleId’ =\> ‘20061208’,  
‘Email’ =\> ‘removed\_email\_address@domain.invalid’, ‘Password’ =\> ‘mypassword’})

Unfortunately I always get this error:

SOAP::Mapping::MappingError: nil not allowed: ArticleId

Here is the schema I am working with:

\<xs:complexType name=“GetArticleRequestType”\>  
xs:sequence  
\<xs:element name=“ArticleId” type=“xs:string”/\>  
\<xs:element name=“Email” type=“xs:string”/\>  
\<xs:element name=“Password” type=“xs:string”/\>  
\</xs:sequence\>  
\</xs:complexType\>

\<xs:element name=“GetArticle” type=“tns:GetArticleType”/\>  
\<xs:complexType name=“GetArticleType”\>  
xs:sequence  
\<xs:element minOccurs=“0” name=“Validate” type=“xs:string”/\>  
\<xs:element minOccurs=“0” name=“XMLEscaping” type=“xs:string”/\>  
\<xs:element maxOccurs=“unbounded” minOccurs=“0”  
name=“Request” type=“tns:GetArticleRequestType”/\>  
\<xs:element minOccurs=“0” name=“Shared”  
type=“tns:GetArticleRequestType”/\>  
\<xs:element minOccurs=“0” name=“SubscriptionId”  
type=“xs:string”/\>  
\</xs:sequence\>  
\</xs:complexType\>

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [September 15, 2008, 3:44pm UTC](https://www.ruby-forum.com/t/soap-complex-type-seen-as-nil/85022/2 "2008-09-15T15:44:57Z")

</div>

Did you solve this problem? I have something simular.

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [May 15, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/soap-complex-type-seen-as-nil/85022/3 "2009-05-15T16:39:47Z")

</div>

Any luck on this one?
