I'm sure this will be very simple for you experts. SUDZC is set up and everything seems to work properly but when a value is returned to the delegate, it is null. the NSLog shows the correct XML response, so i know that it is working properly, but the value in the code is showing null. SUDZC comes with a sample program and this is how it runs. i created a test function on the web service "WhatsYourFavoriteMovie" which returns "Pulp Fiction". The logging clearly shows this value being returned. Why is the final value (null)?? Please help, thank you.
so i call...
[service WhatsYourFavoriteMovie:self action:@selector(WhatsYourFavoriteMovieHandler:) userid: 1];
and then when the web service responds it goes to...
// Handle the response from WhatsYourFavoriteMovie.
- (void) WhatsYourFavoriteMovieHandler: (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(@"WhatsYourFavoriteMovie returned the value: %@", result);
}
however "value" and "result" are always 'null'... as you can see in the NSLog output below it is returning "Pulp Fiction" in the tag. Where am i going wrong?
2012-02-17 17:27:41.487 SudzCExamples[2782:f803] Loading: https://www.mydomain.com/tk_services/tk.asmx
2012-02-17 17:27:41.491 SudzCExamples[2782:f803] <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="com.mynamespace"><soap:Body><WhatsYourFavoriteMovie>
<userid>1</userid></WhatsYourFavoriteMovie></soap:Body></soap:Envelope>
2012-02-17 17:27:41.497 SudzCExamples[2782:f803]
Applications are expected to have a root view controller at the end of application launch
2012-02-17 17:27:45.947 SudzCExamples[2782:f803]
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<WhatsYourFavoriteMovieResponse xmlns="com.mynamespace">
<WhatsYourFavoriteMovieResult>Pulp Fiction</WhatsYourFavoriteMovieResult>
</WhatsYourFavoriteMovieResponse></soap:Body></soap:Envelope>
2012-02-17 17:27:45.949 SudzCExamples[2782:f803] WhatsYourFavoriteMovie returned the value: (null)"
once again, as you can see in the log it got the value "pulp fiction" from the server, but the final line of the log says it returned value 'null'. please help me!! thank you.
I had exactly the same problem with the ARC version of the Sudzc generated code, but for whatever reason the non-ARC version worked fine
UPDATE
Check out this issue report. I made the change suggested in the first comment and the ARC version worked fine.