I just started some tests with sudzc on iOS iPhone app to access a soap service. I used sudzc with the link to the correct wsdl and downloaded the customized code.
Then I initialize the service with:
// Create the service
service = [EMLMagentoService service];
and open a session with:
// Returns NSString*
/* Login user and retrive session id */
SoapRequest *result=[service login:self action:@selector(loginHandler:) username: @"user.test" apiKey: @"GJGDWYgfgjgYGuueyfgue"];
that returns my session ID string... than I use that ID for the next call
// Handle the response from login.
- (void) loginHandler: (id) value {
NSLog(@"##### loginHandler ######");
// Handle errors
if([value isKindOfClass:[NSError class]]) {
NSLog(@"%@", value);
return;
}
// Handle faults
if([value isKindOfClass:[SoapFault class]]) {
NSLog(@"%@", value);
return;
}
NSString *sessionID = (NSString *)value;
[service call:self action:@selector(callHandler:) sessionId:sessionID resourcePath:@"catalog_category.level" args:nil];
}
// Handle the response from call.
- (void) callHandler: (id) value {
NSLog(@"##### callHandler ######");
// Handle errors
if([value isKindOfClass:[NSError class]]) {
NSLog(@"%@", value);
return;
}
// Handle faults
if([value isKindOfClass:[SoapFault class]]) {
NSLog(@"%@", value);
return;
}
NSLog(@"Kind of class: %@",[value class]);
NSLog(@"result:%@", value);
}
What I get is a string without any format... no xml... no array object...
##### loginHandler ######
##### callHandler ######
Kind of class: __NSCFString
result:category_id2parent_id1nameDefault Categoryis_active1position1level1
how can I get an xml or a deserialized object?