The trouble all began with WSMethodInvocationSetParameters
The trouble all began with WSMethodInvocationSetParameters
- Subject: The trouble all began with WSMethodInvocationSetParameters
- From: Andrei Freeman <email@hidden>
- Date: Sat, 8 Oct 2005 10:14:01 -0700
Well, I hope this appropriate for cocoadev, I have exhausted most of
the other paths I could come up with.
I'm trying to work with the XML-RPC components of the Web Services in
Core Services.
In trying to set this up I use for example the following code:
parmOrder = [NSArray arrayWithObjects:@"username",
@"auth_challenge",
@"auth_response", nil];
parmObjects = [NSArray arrayWithObjects:@"username",
challenge,
resp, nil];
parmDict = [NSDictionary dictionaryWithObjects:parmObjects
forKeys:parmOrder];
WSMethodInvocationSetParameters (anRPCRef,
(CFDictionaryRef)parmDict,
(CFArrayRef) parmOrder);
The expected results should look like this
<params><param>
<value><struct>
<member>
<name>username</name>
<value><string>mytestName</string></value>
</member>
<member>
<name>auth_challenge</name>
<value><string>Hex as string gook</string></value>
</member>
<member>
<name>auth_response</name>
<value><string>Hex as string gook</string></value>
</member>
</struct></value>
</param></params>
What I am seeing however (through use of tcpdump) is
<params>
<param>
<value><string>mytestName</string></value>
</param>
<param>
<value><string>Hex as string gook</string></value>
</param>
<param>
<value><string>Hex as string gook</string></value>
</param>
</params>
The entire structure is lost. Placing the dict into an array or
another dict gets me a struct but is often worse having lost data. I
thought that maybe there was a problem with toll-free bridging
between CFDictionary and NSDictionary, but got the same results
either way.
I am guessing that this means that either I have entirely failed to
grok WSMethodInvocationSetParameters or there is a bug.
I tried to then use WSMethodInvocationAddSerializationOverride to see
if I could make a work around.
The definitions for this include the obscure:
typedef CALLBACK_API( CFStringRef ,
WSMethodInvocationSerializationProcPtr )(WSMethodInvocationRef
invocation, CFTypeRef obj, void *info);
I put a call in the early part of my code:
CFStringRef MyDictionaryRender(WSMethodInvocationRef invocation,
CFTypeRef obj, void *info)
{
NSLog(@"MyDictionaryRender ->");
NSLog(@"invocation: %@", invocation);
NSLog(@"obj: %@", obj);
NSLog(@"info: %@", info);
NSLog(@"MyDictionaryRender <-");
return (CFStringRef)@"nil";
Unfortunately, I have had no luck getting anywhere with:
WSMethodInvocationAddSerializationOverride(anRPCRef,
CFGetTypeID
((CFDictionaryRef)parmDict),
(*MyDictionaryRender),
&aContext);
As far as I can tell, MyDictionaryRender isn't being called.
So, the basic questions I have is:
1) Am I correct in thinking this is a bug or am I setting up my
structure incorrectly for WSMethodInvocationSetParameters?
2) Why isn't MyDictionaryRender called/What do I need to do to
properly have it called?
I realize there are other RPC libraries out there. I would just
prefer to not have to overhaul that section at this point.
Thanks,
-Andrei
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden