获取Web页面以响应Objective C中的XMLRPC请求

时间:2015-08-14 11:22:42

标签: ios objective-c web-services xml-rpc

我已经下载了https://github.com/corristo/xmlrpc,我按照说明操作,但我得到了一个回复的网页

NSURL *URL = [NSURL URLWithString:@"www.xyz.com/xmlrpc"];
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];
[request setMethod: @"login" withParameter:@[@usename,@password]];
[manager spawnConnectionWithXMLRPCRequest:request delegate:self];
[request release];

和回复

- (void)request:(XMLRPCRequest *)request didReceiveResponse: (XMLRPCResponse *)response {
    if ([response isFault]) {
        NSLog(@"Fault code: %@", [response faultCode]);

        NSLog(@"Fault string: %@", [response faultString]);
    } else {
        NSLog(@"Parsed response: %@", [response object]);
    }

    NSLog(@"Response body: %@", [response body]);
}

但是我得到了一个响应而不是字符串的网页。

0 个答案:

没有答案