Re: WebKit and POST requests (now WSDL and WSMakeStubs)
Re: WebKit and POST requests (now WSDL and WSMakeStubs)
- Subject: Re: WebKit and POST requests (now WSDL and WSMakeStubs)
- From: Dominik Pich <email@hidden>
- Date: Mon, 25 Jun 2007 19:10:21 +0200
No...... WSCore works for most sites now....
Where do you specify the required parameter though?
And what is the //Missing stuff
Heres how I'd prepare it
NSDictionary *mytype = [NSDictionary dictionaryWithObjectsAndKeys:
mymail, "email", myname, "name", mypassString, "pass",
myarrayofwhatever, "dataArray", nil];
NSDictionary *paramsDict = [NSDictionary
dictionaryWithObjectsAndKeys: mymail, "email", mytype,
"myComplexType", nil];
[callClass setParameters:paramsDict];
[callClass resultValue];
The other interesting bit are the WSxxxxx keys you can assign to any
dictionary to e.g. define the SOAP namespace or the order of the
fields in the xml:
e.g.
//set correct type information
[dict setObject:@"" forKey:(NSString*)kWSRecordNamespaceURI];
[dict setObject:@"m:TSession" forKey:(NSString*)kWSRecordType];
//pay attention to order.. we never had to but with the new software
we do
[dict setObject:[NSArray arrayWithObjects:
@"clientLogInfo",
@"clientName",
@"clientVersion",
@"errorCode",
@"errorMessage",
@"localeID",
@"opID",
@"sessionID",
@"wipeVersion", nil] forKey:(NSString*)kWSRecordParameterOrder];
Regards,
Dominik
On Jun 24, 2007, at 7:14 AM, Sam Stigler wrote:
Hi,
Here's an update on the situation: By inserting an NSLog()
statement just before the call to [super getResultDictionary] in
the stub, I was able to print the result dictionary. It's always
an error from Amazon saying that I'm missing a required parameter
(the same one every time, "ListType"), no matter how I change the
parameters that I'm passing in as an NSDictionary (most recently
entirely composed of NSStrings) using -setParameters: . I think
I've basically traced this to a flaw in how the stub was created,
with it only passing the invocation with one parameter (which was
hardcoded as "body") instead of the at least three that were in my
dictionary. I tried fiddling with the generated files to try make
it work by converting everything to Foundation parameters, e.g., an
NSMutableArray** instead of a C array, but ended up running into so
many memory problems (most of whose causes were not immediately
evident) that I gave up on that after a few hours.
I was looking on the lists.apple.com archive and noticed a post
from Matt Neuburg about a year ago in which he basically said that
WebServicesCore doesn't work for many sites; could my issue be
symptomatic of this? Or am I misreading the whole situation?
Thanks for any help you can give me.
Sam
On Jun 23, 2007, at 3:54 PM, Sam Stigler wrote:
Thanks; that example is very helpful. What I'm trying to do is
access Amazon's web services via SOAP. I tried basically
replicating what you did (see below), but I keep on getting nil
(0x0) resultValues. After studying the WSDL for a little while
I'm guessing it has something with the fact that I'm trying to
substitute in a NSDictionary for a complexType that WSMakeStubs
didn't make a method for; can you (or anyone else), please verify
that? Here's my code:
NSDictionary *ListSearchRequestDict = [NSDictionary
dictionaryWithObjectsAndKeys:[emailAddress
stringValue],@"Email",@"WishList",@"ListType",nil];
ListSearch *theSearch = [[ListSearch alloc] init];
// Missing here: Something like "ListSearchRequest *searchRequest
= [[ListSearchRequest alloc] init]" (this is what WSMakeStubs
didn't generate.)
NSDictionary *listSearchParameters = [NSDictionary
dictionaryWithObjectsAndKeys:@"MY_ACCESS_KEY",@"AWSAccessKeyId",ListS
earchRequestDict,@"Request",nil];
[theSearch setParameters:listSearchParameters];
id search = [theSearch resultValue];
The WSDL file can be found at http://webservices.amazon.com/
AWSECommerceService/AWSECommerceService.wsdl? .
Thanks again,
Sam
On Jun 23, 2007, at 3:44 AM, Mike Stanger wrote:
<snip>
... you then get the results from the query with resultValue
and deal with whatever data structure you get back ... in this
case, I'd expect to be getting back an array, so I'd use
something like:
NSArray *allSectionsArray = [theSections resultValue];
...might be a better way to do it, but this seems pretty simple.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden