I am using SudzC for SOAP web services in an iOS App. The issue I'm facing is, there's a method which is auto generated, and whose parameters contains a simple XML payload. When i send the XML payload as a NSString to the parameter, it automatically converts the & in the XML payload to & amp;
I'm not using any encoding manually in this process. How do I avoid this? Any help would be appreciated.
Edit - This is the part of code which is auto generated and handling by request
if(postData != nil) {
[request setHTTPMethod: @"POST"];
[request addValue: @"text/xml; charset=utf-8" forHTTPHeaderField: @"Content-Type"];
[request setHTTPBody: [postData dataUsingEncoding: NSUTF8StringEncoding]];
if(self.logging) {
NSLog(@"%@", postData);
}
}
Thanks
Nithin
Well, the simple answer is you have to explore the code which has been generated by SudzC. However the hint is, When you request or receive response SudzC code is probably sanitising your code somewhere, most probably method name with serializeElement. If it is a XML request then try to jump to several definition starting from your main method and unto Soap Create method(Just a guess, I am not sure how your code works.) Try to find code similar to this and modify it accordingly.
[[self.YourXML stringByReplacingOccurrencesOfString:@"\"" withString:@"""] stringByReplacingOccurrencesOfString:@"&" withString:@"&"]];