开发者

sudzc how to use the returned object from ws call

开发者 https://www.devze.com 2023-03-06 01:11 出处:网络
The sudzc generated stub is: (void)HandleSearchResult: (id) value { ... The document indicates that \"value\" can be cast into (SDZSearchItems开发者_StackOverflow社区ByUpcResponse *). However that w

The sudzc generated stub is:

(void)HandleSearchResult: (id) value { ...

The document indicates that "value" can be cast into (SDZSearchItems开发者_StackOverflow社区ByUpcResponse *). However that was not true.

In XCode, the type of "value" appears to be __NSCFDictionary.


__NSCFDictionary is a concrete subclass of either NSDictionary or NSMutableDictionary. Handle like so:

-(void)handleSearchResult:(id)value {
    NSDictionary* dict = value;
    NSLog(@"value is: %@", dict);
    // Do what you want with your dictionary
}

I would skip SudzC and use CWXMLTranslator from https://github.com/jayway/CWFoundation. It allows you to ignore most of the cruft in SOAP XML responses, and translates directly to proper domain objects, not dictionaries and other placeholders.

0

精彩评论

暂无评论...
验证码 换一张
取 消