Re: WebServices: kWSMethodInvocationResult empty?
Re: WebServices: kWSMethodInvocationResult empty?
- Subject: Re: WebServices: kWSMethodInvocationResult empty?
- From: Eric Miller <email@hidden>
- Date: Thu, 1 Dec 2005 21:12:20 -0700
On Dec 1, 2005, at 7:25 PM, Joseph Heck wrote:
The quickest way to figure out what's in there is to add
WSMethodInvocationSetProperty
(ref,kWSDebugOutgoingBody,kCFBooleanTrue);
before you invoke the result, and then see what the actual result
body looks like.
Yes, I'm doing that. As I said, I can see what I'm getting back, and
I'm getting back exactly what I want. The problem is that I can
*only* see it by enabling the debug keys.
NSLog( [ result description ] );
Gives me:
"/WSDebugInBody" = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
\n<s:Envelope [ ... snip ... ] </s:Envelope>\n";
"/WSDebugInHeaders" = {
[ ... snip ... ]
};
"/WSDebugOutBody" = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
\n <SOAP-ENV:Envelope [ ... snip ... ] </SOAP-ENV:Envelope>\n\n";
"/WSDebugOutHeaders" = {
[ ... snip ... ]
};
"/kWSHTTPResponseMessage" = <NSCFType: 0x5cd3e0>;
}
This shows me that my rpc is working as expected, at least between me
and flickr. But the kWSMethodInvocationResult key (which would be "/
Result") is not present in this dictionary, so this:
[ result objectForKey:( NSString* )kWSMethodInvocationResult ]
does NOT work as expected, and as documented. It is not intended, I
presume, that developers use APIs with the word debug for something
other than debugging. And I'd just as soon not parse XML by hand,
when I presume WS is supposed to be doing it for me. So something's
not right, but I can't tell what.
Clearer? Thanks for the response.
Eric
On Dec 1, 2005, at 4:59 PM, Eric Miller wrote:
I'm able to get back the response I'm looking for, but it's only
accessible via the debug keys in the result dictionary
(WSDebugInBody, etc). That is, the full xml response *is* being
returned from flickr. But the documented way to access it is
through kWSMethodInvocationResult, and this key does not exist in
the result dictionary:
NSLog( @"result:", [ result objectForKey:( NSString* )
kWSMethodInvocationResult ] );
prints nothing.
I've also tried extracting the CFHTTPMessage from the result, like
this:
CFHTTPMessageRef response = [ result
objectForKey:kWSHTTPResponseMessage ];
NSData* body = ( NSData* )CFHTTPMessageCopyBody( response );
NSDictionary* headers = ( NSDictionary* )
CFHTTPMessageCopyAllHeaderFields( response );
After these calls, headers has some data, but body is nil. This is
frustrating because it's obvious that I did get the full SOAP
response. I'd hate to have to just go in and use the debug info
instead of doing it the "real" way.
Hi Eric,
The quickest way to figure out what's in there is to add
WSMethodInvocationSetProperty
(ref,kWSDebugOutgoingBody,kCFBooleanTrue);
before you invoke the result, and then see what the actual result
body looks like.
_______________________________________________
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