# Empty string in response with method defined by means of add

**URL:** <https://www.ruby-forum.com/t/empty-string-in-response-with-method-defined-by-means-of-add/51941>\
**Category:** Ruby\
**Created:** [January 9, 2006, 3:14pm UTC](https://www.ruby-forum.com/t/empty-string-in-response-with-method-defined-by-means-of-add/51941 "2006-01-09T15:14:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaaaaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c6cbf5/32.png) [@aaaaaa](https://www.ruby-forum.com/u/aaaaaa)\
**Post date:** [January 9, 2006, 3:14pm UTC](https://www.ruby-forum.com/t/empty-string-in-response-with-method-defined-by-means-of-add/51941/1 "2006-01-09T15:14:45Z")

</div>

Hi,

I’m using a java web service with a ruby client. The easiest thing to  
get me up & running quickly was to define the method by means of  
add\_method. Hence, I’m not using WSDL.

Sometimes I get a response where a parameter (formally described in  
WSDL as type=“soapenc:string”) has attribute nil=true. In other  
occasions it’s empty.

The former is recognized by SOAP4R, telling me that the value is nil.  
But the latter gives me a SOAP::Mapping::Object with @\_\_soap\_value={}  
and @soap\_value\_type={}.

I don’t know really what to do with this value. How can I either get an  
empty string or understanand that the resulting object is really empty?

Thanks  
AA

---

<div class="post-metadata">

**Author:** ![aaaaaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c6cbf5/32.png) [@aaaaaa](https://www.ruby-forum.com/u/aaaaaa)\
**Post date:** [February 5, 2006, 2:07pm UTC](https://www.ruby-forum.com/t/empty-string-in-response-with-method-defined-by-means-of-add/51941/2 "2006-02-05T14:07:22Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi,

Sorry for late reply.

aa wrote:

> Sometimes I get a response where a parameter (formally described in  
> WSDL as type=“soapenc:string”) has attribute nil=true. In other  
> occasions it’s empty.
> 
> The former is recognized by SOAP4R, telling me that the value is nil.  
> But the latter gives me a SOAP::Mapping::Object with @\_\_soap\_value={}  
> and @soap\_value\_type={}.
> 
> I don’t know really what to do with this value. How can I either get an  
> empty string or understanand that the resulting object is really empty?

Definitely it’s a bug of soap4r… cf.  
[http://dev.ctor.org/soap4r/ticket/189](http://dev.ctor.org/soap4r/ticket/189) . I’ll try to solve this soon.

Regards,  
// NaHi  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFD5fhKf6b33ts2dPkRAp8MAJ9RwhOyFi9NB9dZVUFpy/rc8Gw84QCgg1g3  
oJWuqYiN7B7TeajlfNmRam0=  
=ayGg  
-----END PGP SIGNATURE-----
