Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在objective-c中,通过xml Rpc通过odoo服务器获取响应时出现问题_Ios_Objective C_Iphone_Odoo_Xml Rpc - Fatal编程技术网

Ios 在objective-c中,通过xml Rpc通过odoo服务器获取响应时出现问题

Ios 在objective-c中,通过xml Rpc通过odoo服务器获取响应时出现问题,ios,objective-c,iphone,odoo,xml-rpc,Ios,Objective C,Iphone,Odoo,Xml Rpc,客户端应用程序代码 XMLRPCRequest *request=[[XMLRPCRequest alloc] initWithURL:[NSURL URLWithString:server_url]]; NSArray *param=[NSArray arrayWithObjects:@"demoDB",user_id,password, nil]; [request setMethod:@"user_data" withParameters:param]; XMLRP

客户端应用程序代码

XMLRPCRequest *request=[[XMLRPCRequest alloc] initWithURL:[NSURL URLWithString:server_url]];

    NSArray *param=[NSArray arrayWithObjects:@"demoDB",user_id,password, nil];

    [request setMethod:@"user_data" withParameters:param];


XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];

XMLRPCResponse *response=[XMLRPCConnection sendSynchronousXMLRPCRequest:request error:nil ];

    NSString* result = [response body];

    NSLog(@"%@",result);

    if ([response faultCode]==0)

    {

        NSDictionary *xmlDoc = [NSDictionary dictionaryWithXMLString:result];

        NSLog(@"%@",xmlDoc);

    }else

    {

        NSString* error = @"error";

        NSLog(@"%@",error);

    }
$url = "http://www.someurl.com:8069";

$db = "demoDB";

$email = "someid@---";

$password = "******";

require_once('ripcord-1.1/ripcord.php');

$common = ripcord::client("$url/xmlrpc/2/common");

$uid = $common->authenticate($db, $email, $password, array());

$models = ripcord::client("$url/xmlrpc/2/object");

if ($uid) {
    #first load username
    $user_data = $models->execute_kw($db, $uid, $password,
        'res.users', 'read',
        array($uid),
        array('fields'=>array('name', 'company_id')));

} else {
    echo "failed";
}
服务器端PHP代码

XMLRPCRequest *request=[[XMLRPCRequest alloc] initWithURL:[NSURL URLWithString:server_url]];

    NSArray *param=[NSArray arrayWithObjects:@"demoDB",user_id,password, nil];

    [request setMethod:@"user_data" withParameters:param];


XMLRPCConnectionManager *manager = [XMLRPCConnectionManager sharedManager];

XMLRPCResponse *response=[XMLRPCConnection sendSynchronousXMLRPCRequest:request error:nil ];

    NSString* result = [response body];

    NSLog(@"%@",result);

    if ([response faultCode]==0)

    {

        NSDictionary *xmlDoc = [NSDictionary dictionaryWithXMLString:result];

        NSLog(@"%@",xmlDoc);

    }else

    {

        NSString* error = @"error";

        NSLog(@"%@",error);

    }
$url = "http://www.someurl.com:8069";

$db = "demoDB";

$email = "someid@---";

$password = "******";

require_once('ripcord-1.1/ripcord.php');

$common = ripcord::client("$url/xmlrpc/2/common");

$uid = $common->authenticate($db, $email, $password, array());

$models = ripcord::client("$url/xmlrpc/2/object");

if ($uid) {
    #first load username
    $user_data = $models->execute_kw($db, $uid, $password,
        'res.users', 'read',
        array($uid),
        array('fields'=>array('name', 'company_id')));

} else {
    echo "failed";
}

试试这个例子,也许对你有帮助

使用xml解析在iOS中调用SOAP Web服务

如果您能发布您的代码(从客户端和服务器端)将会很有帮助。请您将您的邮件给我。我不知道O-C,所以我认为我不能帮助您,但其他人可以。这就是我建议你发布代码的原因。如果共享时出现问题,您可以尝试稍加修改,但在不知道您到底在做什么的情况下,很难判断您做错了什么。@Vivek再次检查