• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WebServices / WSMethodInvocationSetCallBack question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Cocoa-Java????
  • Next by Date: Re: Cocoa and ... Pascal!!!
  • Previous by thread: [ANN] SSHTunnelManager 1.0.1
  • Next by thread: ANN: MOKit project starting up on SourceForge
  • Index(es):
    • Date
    • Thread