# Doc literal with soap4r

**URL:** <https://www.ruby-forum.com/t/doc-literal-with-soap4r/77875>\
**Category:** Ruby\
**Created:** [December 1, 2006, 5:24am UTC](https://www.ruby-forum.com/t/doc-literal-with-soap4r/77875 "2006-12-01T05:24:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [December 1, 2006, 5:24am UTC](https://www.ruby-forum.com/t/doc-literal-with-soap4r/77875/1 "2006-12-01T05:24:44Z")

</div>

Since I’m not a soap expert I thought I would ask. The following soap  
message isn’t accepted by Netsuite, and their apache axis server  
throws an exception about not being able to marshal the data.  
Netsuite say’s the soap messages should be in doc literal format. Is  
it? Are there any options to soap4r to get it to format messages more  
like the second example below? Their example soap request is  
structured a bit differently, I included it at the bottom of this  
message.

My soap message, makes server throw a marshalling error.

\<?xml version="1.0" encoding="utf-8" ?\>

\<env:Envelope xmlns:xsd=“[XML Schema](http://www.w3.org/2001/XMLSchema)”  
xmlns:env=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”  
xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)”\>  
env:Body  
\<n1:login  
xmlns:n1=“urn:messages\_2\_5.platform.webservices.netsuite.com”  
xmlns:n2=“urn:core\_2\_5.platform.webservices.netsuite.com”  
xsi:type=“n2:Passport”\>  
n2:emailremoved\_email\_address@domain.invalid\</n2:email\>  
n2:passwordXXXXXX\</n2:password\>  
n2:account999999\</n2:account\>  
\</n1:login\>  
\</env:Body\>  
\</env:Envelope\>

Netsuite sample:

soap:Body\>  
platformMsgs:login  
platformMsgs:passport  
platformCore:emailremoved\_email\_address@domain.invalid\</platformCore:email\>  
platformCore:passwordCracker1\</platformCore:password\>  
platformCore:account111111\</platformCore:account\>  
\</platformMsgs:passport\>  
\</platformMsgs:login\>  
\</soap:Body\>

---

<div class="post-metadata">

**Author:** ![snacktime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@snacktime](https://www.ruby-forum.com/u/snacktime)\
**Post date:** [December 1, 2006, 5:38pm UTC](https://www.ruby-forum.com/t/doc-literal-with-soap4r/77875/2 "2006-12-01T17:38:46Z")

</div>

On Nov 30, 2006, at 10:22 PM, snacktime wrote:

> Since I’m not a soap expert I thought I would ask. The following soap  
> message isn’t accepted by Netsuite, and their apache axis server  
> throws an exception about not being able to marshal the data.  
> Netsuite say’s the soap messages should be in doc literal format. Is  
> it? Are there any options to soap4r to get it to format messages more  
> like the second example below? Their example soap request is  
> structured a bit differently, I included it at the bottom of this  
> message.

There is an option to turn on doc/literal in soap4r. I forget where  
it is, but the soap4r examples on [dev.ctor.org](http://dev.ctor.org) are a treasure trove -  
way better than the documentation.

> ```
> xsi:type="n2:Passport">
> <n2:email>removed_email_address@domain.invalid</n2:email>
> <n2:password>XXXXXX</n2:password>
> <n2:account>999999</n2:account>
> 
> ```
> 
> \</n1:login\>  
> \</env:Body\>  
> \</env:Envelope\>

From the example below, looks like your namespace is wrong and  
you’re missing that passport element. Are you generating these  
messages yourself (using soap4r) or are you using a wsdl4r-generated  
client?
