WebServices / WSMethodInvocationSetCallBack question
WebServices / WSMethodInvocationSetCallBack question
- Subject: WebServices / WSMethodInvocationSetCallBack question
- From: Gus Mueller <email@hidden>
- Date: Wed, 4 Dec 2002 15:12:42 -0800
Hi, I'm trying to use the WSMethodInvocationSetCallBack function in
10.2's Web services framework, but I'm getting stuck.
I've defined my callback function as:
void callback(WSMethodInvocationRef invocation, void *info,
CFDictionaryRef outRef);
and the docs say it's supposed to look like:
typedef CALLBACK_API( void ,
WSMethodInvocationCallBackProcPtr)(WSMethodInvocationRef invocation,
void *info, CFDictionaryRef outRef);
So I believe I have that right... but when I'm calling
WSMethodInvocationSetCallBack I get a crash.
WSMethodInvocationSetCallBack(rpcCall, callback, &context);
Has anyone got any idea what I'm doing wrong? I've got the relevent
code below if it would help anyone figure out my problem...
thanks,
-gus
void callback(WSMethodInvocationRef invocation, void *info,
CFDictionaryRef outRef) {
XMLRPCDemo *me = (XMLRPCDemo*)info;
NSLog(@"got the callback for %@!", me);
}
- (IBAction) doCall: (id) sender {
WSMethodInvocationRef rpcCall;
NSURL *rpcURL = [NSURL URLWithString:
@"
http://localhost/milo/servlet/com.ddi.web.issuetracker.NotificationListener"];
NSString *methodName =
@"itracker.getNotifcationsForTheLastHours";
NSDictionary *params = [NSDictionary dictionaryWithObject:
[NSNumber numberWithInt:5] forKey: @"foo"];
NSDictionary *result;
rpcCall = WSMethodInvocationCreate ((CFURLRef) rpcURL,
(CFStringRef) methodName, kWSXMLRPCProtocol);
WSMethodInvocationSetParameters (rpcCall, (CFDictionaryRef)params,
nil);
WSClientContext context;
context.info = self;
NSLog(@"setting...");
// This works fine...
// result = (NSDictionary *)WSMethodInvocationInvoke(rpcCall);
// NSLog(@"%@", result);
// these guys crash
// WSMethodInvocationSetCallBack(rpcCall,
(WSMethodInvocationCallBackProcPtr)callback, &context);
// WSMethodInvocationSetCallBack(rpcCall, &callback, &context);
WSMethodInvocationSetCallBack(rpcCall, callback, &context);
// I never get here.
NSLog(@"all set");
}
--
"Christmas means carnage!" -- Ferdinand, the duck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.