rsjudge17 / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

How to send a JSON type string as a parameter? #198

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Call a webservice with json type string as a parameter.
2. Some characters(like {,[,",: ) were encoded to URL type characters like %7B, 
%5B when the parameter string is added to XML node.
3. Server returns error because parameter type is incorrect.

My question is,

1) Is there a way to send a JSON type string parameter when using wsdl2objc?
2) Is there a way to use XML CDATA section when using wsdl2objc? (to use json 
type string in xml)

thanks.

Original issue reported on code.google.com by tsstc...@gmail.com on 21 Feb 2013 at 11:35

GoogleCodeExporter commented 9 years ago
for example,
original JSON string is

{"name":"jone","mobile":"010-777-7777" 

like this,

but encoded string is

{"name":"후승","mobile":"010-7777-7777&

Any solution?

Original comment by tsstc...@gmail.com on 21 Feb 2013 at 2:35

GoogleCodeExporter commented 9 years ago
i have the same issue
..

Original comment by cokeco...@gmail.com on 23 May 2013 at 8:36

GoogleCodeExporter commented 9 years ago
you can replace the &quot to "
- (NSString *)serializedFormUsingHeaderElements:(NSDictionary *)headerElements 
bodyElements:(NSDictionary *)bodyElements

  return [serializedForm stringByReplacingOccurrencesOfString:@""" withString:@"\""];

}

Original comment by cokeco...@gmail.com on 23 May 2013 at 9:29

GoogleCodeExporter commented 9 years ago
can u give clear code how to replace it
and were does the "serializedForm" comes from ?

Original comment by anand...@gmail.com on 26 Aug 2014 at 6:11