• 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
Fwd: WebServices Question (plus some additional details)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: WebServices Question (plus some additional details)


  • Subject: Fwd: WebServices Question (plus some additional details)
  • From: Tom Ryan <email@hidden>
  • Date: Tue, 30 Dec 2003 18:36:35 -0500

Whoops, somehow this got mixed in with another thread. sorry about that
folks!

--Tom Ryan

Does anyone have any light to bring to this?

Begin forwarded message:

> From: Tom Ryan <email@hidden>
> Date: December 29, 2003 6:24:55 PM EST
> To: email@hidden
> Subject: WebServices Question
>
> Hi folks,
>
> I've got this troublesome question that's been bugging me for a while,
> and hope that someone here can help me out:
>
> I'm writing an app that hits a .NET Web Service. I can successfully
> return results for single objects:
> * A class defined on the server:
> ** LLSession
> --property: username
> --property: password
> --property :siteid
> --property: passwordExpiresInDays
>
> This, as I said, works just fine.
>
> However, when I try to return a *collection* of objects (actually a
> .NET DataSet or XmlDataDocument), while I see in the debug headers that
> everything in the DataSet/XmlDataDocument is returned, the NSDictionary
> into which the results are being poured only returns the *last* item in
> that set of data. I'm looking to grab the data and dump into an
> NSBrowser or NSOutlineView...
>
> Does anyone have any experience with this?
>
> Here's the code I use to invoke the WebService method:
> ==============BEGIN INVOKE =============
> - (NSDictionary *)invoke:(NSString *)host
> methodName:(NSString *)methName
> methodNamespace:(NSString *)ns
> soapAction:(NSString *)action
> parameters:(NSDictionary *)params
> paramsOrder:(NSArray *)orderOfParams
> {
> WSMethodInvocationRef soapCall;
> NSURL *soapURL;
> NSDictionary *result;
> NSDictionary *dictToReturn;
>
> soapURL = [NSURL URLWithString:host];
> soapCall = WSMethodInvocationCreate((CFURLRef)soapURL,
> (CFStringRef)methName, kWSSOAP2001Protocol);
> NSDictionary *headers = [NSDictionary dictionaryWithObject:action
> forKey:@"SOAPAction"];
>
> NSString *keyResult = [NSString stringWithFormat:@"%@Result",
> methName];
>
> WSMethodInvocationSetParameters(soapCall, (CFDictionaryRef)params,
> (CFArrayRef)orderOfParams);
> WSMethodInvocationSetProperty(soapCall, kWSSOAPMethodNamespaceURI,
> ns);
> WSMethodInvocationSetProperty(soapCall, kWSHTTPExtraHeaders, headers);
>
> result = (NSDictionary *)WSMethodInvocationInvoke(soapCall);
> dictToReturn = [result objectForKey:(NSString
> *)kWSMethodInvocationResult];
>
> return [dictToReturn objectForKey:keyResult];
> }
> ============== END INVOKE =============
>
> Here is the method to return the (as defined in .NET) XmlDataDocument:
> ============= BEGIN loadCHILDREN ===============
> - (NSDictionary *)loadChildren:(LLSession *)sess volID:(int)v
> nodeID:(int)n {
> NSString *methodName = @"getChildren";
> NSString *soapNameSpace =
> @"urn:mycompany.it.livelinkaccess.webservices";
> NSString *soapAction = @"urn:
> mycompany.it.livelinkaccess.webservices/getChildren";
> NSNumber *vid = [NSNumber numberWithInt:v];
> NSNumber *nid = [NSNumber numberWithInt:n];
>
> NSArray *aryUserVals = [NSArray arrayWithObjects:
> [session sessionAsDictionary],
> vid,
> nid,
> nil];
> NSArray *aryUserKeys = [NSArray arrayWithObjects:
> @"session",
> @"volumeId",
> @"nodeId",
> nil];
>
> NSDictionary *childDict = [NSDictionary
> dictionaryWithObjects:aryUserVals forKeys:aryUserKeys];
>
> NSArray *paramsOrder = [NSArray arrayWithObjects:@"session",
> @"volumeId", @"nodeId", nil];
> NSDictionary *dict = [connect invoke:hostname
> methodName:methodName
> methodNamespace: soapNameSpace
> soapAction: soapAction
> parameters:childDict
> paramsOrder:paramsOrder];
> return dict;
> } // this method works fine for data objects that are not collections
> ============= END loadCHILDREN ===============
>
> Thanks in advance for your help,
>
> Tom Ryan
> _______________________________________________
> 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.
_______________________________________________
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: development vs deployment
  • Next by Date: Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
  • Previous by thread: Re: create new folder
  • Next by thread: Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
  • Index(es):
    • Date
    • Thread