Forum: Ruby on Rails Problems with SOAP: duplicate XML declarations

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
on 2007-06-17 20:45
(Received via mailing list)

I'm trying to implement a SOAP client using the native Ruby SOAP
client library.  Here's the relevant bit of code:

     XSD::Charset.encoding = 'UTF8'                       # Set
     wsdlfile = ""     # WSDL
     driver =     # Create

# and set up

# methods
     driver.wiredump_dev = STDERR # output SOAP transactions to STDERR
     @result = driver.SendCharFax({:Username => username, :Password =>
password, :FaxNumber => destinationfaxnumber, :Data =>
'hello', :FileType => ''})

For some reason, this is sending XML with two XML declarations!  Here
is what it is sending:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd=""
<?xml version="1.0" encoding="UTF-8"?>

I've tried to figure out what's going, tried searching Google and also
asked another Ruby developer, but neither of us have a clue why it's
doing this.

Can anybody point me in the right direction?


PS: This is the first application I've written in Ruby.. so don't
discount obvious solutions ;)
on 2007-06-17 22:32
(Received via mailing list)
I haven't done too much SOAP, but what I have done, I did pretty much
exactly the way you did. So, this looks like a bug to me. You might
want to post this to the Ruby list... Also, the Ruby soap
implementation is otherwise known as SOAP4r and it has a trac and some
help here:

If you figure it out, please do post it here!

on 2007-06-18 02:54
(Received via mailing list)
Thanks, I was rather confused about all the different SOAP libraries
around, so thanks for telling me what soap4r is.  It looks like a bug
to me too, but I didn't think I was doing anything particularly
unusual so I suspected my ineptitude more than a bug in a well-used
piece of code.

I'll post it to the Ruby list... signing up via Google G. didn't
work so I guess I'll have to do it the old-fashioned way.


This topic is locked and can not be replied to.