[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problems with SOAP: duplicate XML declarations

ruby@orangejon.com

6/17/2007 11:02:00 PM

Hi,

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
encoding
wsdlfile = "http://ws.interfax.net/dfs.asmx?... # WSDL
location
driver =
SOAP::WSDLDriverFactory.new(wsdlfile).create_rpc_driver # Create
driver

# 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="http://www.w3.org/2001/XMLSc...
xmlns:env="http://schemas.xmlsoap.org/soap/envel...
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance...
<env:Body>
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<Password>pass123</Password>
<FaxNumber>001801751234</FaxNumber>
<FileType></FileType>
<Data>hello</Data>
<Username>faxuser</Username>
</hash>
</env:Body>
</env:Envelope>

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?

Cheers,

Jon
PS: This is the first application I've written in Ruby.. so don't
discount obvious solutions ;)


4 Answers

NAKAMURA, Hiroshi

6/18/2007 1:34:00 PM

0

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

Hi,

ruby@orangejon.com wrote:
> I'm trying to implement a SOAP client using the native Ruby SOAP
> client library. Here's the relevant bit of code:

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

What version of soap4r are you using? The versions from
soap4r-1.5.5.20070519 to soap4r-1.5.5.20070605 try to call 'to_xml'
method of parameters. Later versions try to call 'to_xmlpart' instead
of 'to_xml'. Just updating soap4r should solve the problem.

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRnaJuh9L2jg5EEGlAQIQVAf/TsfXyi1xyjjkr+4E+j3FVBW46nRNbbxu
HktnHj3OQMIotpv9FAGv0jGJq+C87ca9fCQSg+4xV8fauSVWEkZXJHotRkZ+gTQS
3lOtU8+IAvSuxzlMGIWjUgwFXkSTSeN/SvWrbt0cdk/pINIumxl5ATaRQ/WK6gUD
kqf9WMpbwUfvRuiNqnmmMWk5rPpBoLnoLWB3/wnFS+ksodZOcUGFDTRdGs0Ivo9h
mlz+b31JhQoIFaxsWcucMuM0itpuzgfTEe2eYFe7sBbEY1p7W4fF3Lc+238ydu6q
xqfTBUz0+ajIzmMIboLN6otGob5OcnwR7aUNMa97HYLnq81ryWHmNg==
=4hGI
-----END PGP SIGNATURE-----

ruby@orangejon.com

6/19/2007 1:15:00 AM

0

Yay! I updated all my gems ("gem update") including soap4r, restarted
the server and voila! Correct XML and it's all working again :)

Thanks for your help!

Cheers,

Jon

On Jun 18, 3:34 pm, "NAKAMURA, Hiroshi" <nakah...@sarion.co.jp> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> r...@orangejon.com wrote:
> > I'm trying to implement a SOAP client using the native Ruby SOAP
> > client library. Here's the relevant bit of code:
> > For some reason, this is sending XML with two XML declarations! Here
> > is what it is sending:
>
> What version of soap4r are you using? The versions from
> soap4r-1.5.5.20070519 to soap4r-1.5.5.20070605 try to call 'to_xml'
> method of parameters. Later versions try to call 'to_xmlpart' instead
> of 'to_xml'. Just updating soap4r should solve the problem.
>
> Regards,
> // NaHi
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (Cygwin)
>
> iQEVAwUBRnaJuh9L2jg5EEGlAQIQVAf/TsfXyi1xyjjkr+4E+j3FVBW46nRNbbxu
> HktnHj3OQMIotpv9FAGv0jGJq+C87ca9fCQSg+4xV8fauSVWEkZXJHotRkZ+gTQS
> 3lOtU8+IAvSuxzlMGIWjUgwFXkSTSeN/SvWrbt0cdk/pINIumxl5ATaRQ/WK6gUD
> kqf9WMpbwUfvRuiNqnmmMWk5rPpBoLnoLWB3/wnFS+ksodZOcUGFDTRdGs0Ivo9h
> mlz+b31JhQoIFaxsWcucMuM0itpuzgfTEe2eYFe7sBbEY1p7W4fF3Lc+238ydu6q
> xqfTBUz0+ajIzmMIboLN6otGob5OcnwR7aUNMa97HYLnq81ryWHmNg==
> =4hGI
> -----END PGP SIGNATURE-----


fformby

1/21/2010 9:30:00 AM

0

On Fri, 22 Jan 2010 21:35:30 +0900, "Fartingo" <farnindo@att.net>
wrote:

>
>"The Revd" <fformby@smythe.com> wrote in message
>news:4b56d6e5.64577453@news.x-privat.org...
>> On Thu, 21 Jan 2010 20:30:17 +0900, "Fartingo@att.net> wrote:
>>
>>>
>>>"The Revd" <fformby@smythe.com> wrote in message
>>>news:4b5563dc.5689765@news.x-privat.org...
>>>> On Thu, 21 Jan 2010 00:48:52 +0900, "Fartingo" <farnindo@att.net>
>>>
>>>> You've never even seen a clit, you faggot cunt, Fartingo!
>>>> LOL
>>>
>>>Here's your clit, Muzzie asshole.
>>>
>>> http://home.att.net/~extremebubble128/nin...
>>
>> I don't do links, jew cocksucker.
>
>You don;t have to do links fuckface!
>Other muzzie assholes do it for you.
>To make it easy for them to find you,
>I'll top-post your disgusting slut!
>lol!

Pidgin English noted, you illiterate cunt.

Farnindo

1/21/2010 11:30:00 AM

0


"The Revd" <fformby@smythe.com> wrote in message
news:4b5563dc.5689765@news.x-privat.org...
> On Thu, 21 Jan 2010 00:48:52 +0900, "Fartingo" <farnindo@att.net>

> You've never even seen a clit, you faggot cunt, Fartingo!
> LOL

Here's your clit, Muzzie asshole.

http://home.att.net/~extremebubble128/nin...

I can remove it for you. A #12 wire cutter will do
LOL!