Re: WebServices: kWSMethodInvocationResult empty?
Re: WebServices: kWSMethodInvocationResult empty?
- Subject: Re: WebServices: kWSMethodInvocationResult empty?
- From: Joseph Heck <email@hidden>
- Date: Thu, 1 Dec 2005 18:25:31 -0800
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.
When I'm debugging, I usually NSLog the resulting dictionary and see
what's in there:
NSLog(@"%@",[fResult description]);
Very often, you need to pull back a specific key to get the results,
depending on how to SOAP message was formatted. For example, against
the WSDL file
http://www.atomic-x.com/xmlservices/congressmembers.asmx?WSDL and
using the method GetMemberByState, you need to look for the key
GetMemberByStateResult.
[fResult objectForKey:@"GetMemberByStateResult"];
Just glancing around in the resulting dictionary will give you a huge
amount of info there.
-joe
_______________________________________________
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