开发者

sudzC handle parameters

开发者 https://www.devze.com 2023-04-12 05:17 出处:网络
I m just started a new project which requires communication with a soap webservice developped by another company

I m just started a new project which requires communication with a soap webservice developped by another company

The functions requires some paramters ex:

TPLogin

parameters required:

SLogin=XXX
SPassword=XXX

my question is :

how do I pass theses parameters , as exemple provided with generated code only call the functions without any params ?

from exemple code generated;

[service TPLogin:self action:@selector(TPLoginHandler:)];



// Handle the respo开发者_JAVA技巧nse from TPLogin.

- (void) TPLoginHandler: (id) value {

// Handle errors
if([value isKindOfClass:[NSError class]]) {
    NSLog(@"%@", value);
    return;
}

// Handle faults
if([value isKindOfClass:[SoapFault class]]) {
    NSLog(@"%@", value);
    return;
}               


// Do something with the NSString* result
    NSString* result = (NSString*)value;
NSLog(@"TPLogin returned the value: %@", result);

}


what is 'service'?

[self performSelector:@selector(TPLoginHandler:) withObject:[NSDictionary dictionaryWithObjectsAndKeys:@"blarblar",@"SLogin", @"blarblar",@"SPassword", nil]];

-(void)TPLoginHandler:(NSDictionary *)info
{
    //you can access about below code.
    [info valueForKey:@"SLogin"];
    [info valueForKey:@"SPassword"];
}
0

精彩评论

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