开发者

sudzc how to use the returned object from ws call

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜