nfajardo / sudzc

Automatically exported from code.google.com/p/sudzc
0 stars 0 forks source link

XML String incorrectly escaped #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use an XML formatted string as a string

What is the expected output? What do you see instead?

I expect the server to receive that XML string escaped correctly.

The XML string seems to get mangled with strange & escaping. 

What version of the product are you using? On what operating system?

Mac OS X 10.6.5

Please provide any additional information below.

Original issue reported on code.google.com by john%zic...@gtempaccount.com on 14 Dec 2010 at 4:46

GoogleCodeExporter commented 8 years ago
Cause: & is being escaped twice. Once in somewhere in SoapParameter -xml 
method, second in Soap -createEnvelope:forNamespace:forParameters:withHeaders: 
method.

Fix: I repaired this problem by changing line 42 in Soap.m from

[s appendFormat: @"<%@>%@</%@>", method, params 
stringByReplacingOccurrencesOfString:@"&" withString:@"&"], method];
to
[s appendFormat: @"<%@>%@</%@>", method, params, method];

However, it needs further testing to make sure this fix has no side effects.

Original comment by cathack on 20 May 2011 at 1:44