Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOAP request with XML broken in 0.7.6 #50

Closed
rurounijones opened this issue Mar 24, 2010 · 8 comments
Closed

SOAP request with XML broken in 0.7.6 #50

rurounijones opened this issue Mar 24, 2010 · 8 comments

Comments

@rurounijones
Copy link

My requests have been broken by 0.7.6, rolling back to 0.7.5 fixes the issue. I think it is probably caused by the fix for issue #41. I have to send XML inside a soap field and it is getting escaped which the system at the other end (Which I have no control over) cannot read it.

Here an excerpt from a soap request as sent by 0.7.6 (Captured by wireshark) - BROKEN

<wsdl:MsgXML>&lt;![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;COMMAND&gt;&lt;Parameters&gt;&lt;FieldName=&quot;OUTPUT&quot;

And here is the same XML as sent by 0.7.5 - WORKING

<wsdl:MsgXML><![CDATA[<?xml version="1.0" encoding="utf-8"?><COMMAND><Parameters><FieldName="OUTPUT"

Maybe we need to be able to set a setting to tell Savon to escape or not?

@rubiii
Copy link
Contributor

rubiii commented Mar 27, 2010

thinking about a solution for this. what about something like this?

{ :first! => "<tag />", :second => "<tag />" }.to_soap_xml
# => "<first>&lt;tag /&gt;</first><second><tag /></second>"

appending an exclamation mark to a key would force the value to be escaped.

@rurounijones
Copy link
Author

That looks like a pretty solid suggestion. This is personal preference but I would switch it. Make the exclamation make not escape anything. ! means "I really really mean it" in terms of what is entered into the field while no ! means "Ok, you can modify it"

That is just my personal preference. Either way that fix works for me!

@laucb
Copy link

laucb commented Apr 2, 2010

I returned to version 0.7.5 for the same reason.
It would be nice to skip the encoding inside the CDATA.

@rubiii
Copy link
Contributor

rubiii commented May 9, 2010

added a fix for this issue to the dev branch (http://github.com/rubiii/savon/commit/76a82c484d1d2fa86e931d340ffa9add96d435b0). going to release the next version soon.

ps. implemented the suggestion by rurounijones. everything is escaped by default, but you can mark hash keys with an exclamation mark to have them not escaped.

@rubiii
Copy link
Contributor

rubiii commented May 9, 2010

released version 0.7.8 which should fix this issue. feedback appreciated :)

@rurounijones
Copy link
Author

Excellent, I cannot test this until tomorrow but will let you know!

@rurounijones
Copy link
Author

Looks like I was wrong, I could test it today.
I was on 0.7.5
All tests pass
Upgrade to 0.7.8
6 test failures
Update code to use exclamation marks where appropriate
All tests pass

As fast as I am concerned it is fixed.I am a happy bunny; thank you, I am not going to close the issue because I didn't test anything to do with Laucode's request (Automatically skip encoding inside CDATA)

@rubiii
Copy link
Contributor

rubiii commented May 17, 2010

currently savon does not automatically skip encoding inside CDATA tags. that would mean "parsing" every input value, so i postponed it until it's really really needed. thanks for the feedback!

calamitas pushed a commit to calamitas/savon that referenced this issue Jun 7, 2011
savon still defaults to escape special characters in a given request hash, but does not escape values for keys that end with an exclamation mark.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants