Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Handle result/fault from webservice call in Cairngorm 2   Message List  
Reply | Forward Message #42122 of 149666 |
Re: Handle result/fault from webservice call in Cairngorm 2

I am also having trouble with Web Services in Cairngorm 2. The execute
method of my command is being called, but the WS call is not being
made, much less handled correctly. Can someone tell me what I am
missing here?

From Services.xml:

<mx:WebService id="industryAndSizeIdsService" makeObjectsBindable="false"

wsdl="{TestModel.getInstance().appConfigData.client_measures_url.@value
+ '?WSDL'}"
showBusyCursor="true" useProxy="false"
result="event.token.resultHandler(event)"
fault="event.token.faultHandler(event)">

<mx:operation name="GetDataByGrouping" resultFormat="e4x">
<mx:request>
<GroupingRequests>
<GroupName>
RPRToolStaticData
</GroupName>
</GroupingRequests>
</mx:request>
</mx:operation>
</mx:WebService>

And here is the call in my command class:

public class LoadIndustryAndSizeIdsCommand implements Command, Responder
{
public function execute(event:CairngormEvent):void
{
var service:AbstractService =
ServiceLocator.getInstance().getService("industryAndSizeIdsService");
var call:AsyncToken = service.GetDataByGrouping.send();
call.addEventListener(mx.rpc.events.FaultEvent.FAULT, onFault);
call.addEventListener(mx.rpc.events.ResultEvent.RESULT, onResult);
trace("execute");
}

public function onResult(event:* = null):void
{
trace("result");
}

public function onFault(event:* = null):void
{
trace("fault");
}
}

Thanks,
Ben







Wed Jul 5, 2006 1:35 pm

ben.clinkinb...
Offline Offline
Send Email Send Email

Forward
Message #42122 of 149666 |
Expand Messages Author Sort by Date

I setup an new Project in Flex 2 using Cairngorm 2 and now I'm trying to handle result/fault coming from a webservice. I created a subclass of ServiceLocator...
Artur Kordowski
groups@...
Send Email
Jul 4, 2006
12:26 pm

... Eww. Why not use a delegate ? ... That had delegates that worked the same way as in 2.0 -- Tom Chiverton ...
Tom Chiverton
tom.chiverton
Offline Send Email
Jul 4, 2006
2:37 pm

Add event listeners on the call since he's a WebService for "fault" and "result". call.addEventListener(mx.rpc.events.FaultEvent.FAULT, onFault); ...
JesterXL
jesterxl@...
Send Email
Jul 4, 2006
2:52 pm

With Cairngorm, have your commands implement the Command and the Responder, then you have the onResult and onFault calls to handle as you will. You pass the...
Stacey Mulcahy
bitchwhocodes
Offline Send Email
Jul 4, 2006
5:37 pm

@Tom ... The delegate class is not longer available in the flex framework, so I can't use it. @Jester I've got still an error. Here my code how I've build it. ...
Artur Kordowski
groups@...
Send Email
Jul 6, 2006
12:47 am

@Tom ... The delegate class is not longer available in the flex framework, so I can't use it. @Jester I've got still an error. Here my code how I've build it. ...
Artur Kordowski
groups@...
Send Email
Jul 5, 2006
11:30 am

... It was never in the flex framework, it's a Cairngorm convention. -- Tom Chiverton **************************************************** This email is sent...
Tom Chiverton
tom.chiverton
Offline Send Email
Jul 5, 2006
1:17 pm

But the Delegate class used in Delegate.create() seems to be missing from AS3, so how would you use Delegates? Thanks, Ben ... England and Wales under...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 5, 2006
8:07 pm

Ben, The Delegate they're mentioning (in Cairngorm) is a design pattern and is not the same as the Delegate class that you're thinking of, from AS2. Scott ... ...
slangeberg
scoobeedogg
Offline Send Email
Jul 5, 2006
9:23 pm

I guess maybe I should clarify that my experience with Cairngorm is pretty much limited to Steven's article on devnet. ...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 6, 2006
1:24 am

... package com.x.y.z.service { import mx.rpc.AbstractService; import mx.collections.ArrayCollection; import com.adobe.cairngorm.business.Responder; import...
Tom Chiverton
tom.chiverton
Offline Send Email
Jul 6, 2006
9:50 am

Thanks Tom, I was actually able to see some similar code last night in Alex Uhlmann's latest article. I will ask you the same thing I asked him: would it look...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 6, 2006
12:33 pm

... I don't imagine very much so, no. -- Tom Chiverton **************************************************** This email is sent for and on behalf of Halliwells...
Tom Chiverton
tom.chiverton
Offline Send Email
Jul 6, 2006
2:01 pm

OK, if I do a describeType(responder) within my delegate class, I see that it does contain a reference to the correct command class, and it sees the onResult...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 6, 2006
1:57 pm

... Can you knock up a quick test file against a public web service, and post that ? -- Tom Chiverton **************************************************** This...
Tom Chiverton
tom.chiverton
Offline Send Email
Jul 6, 2006
3:43 pm

Thanks Tom, I have actually gotten my head around this and seen some great example code thanks to Jesse and Darron. ...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 6, 2006
5:41 pm

I am also having trouble with Web Services in Cairngorm 2. The execute method of my command is being called, but the WS call is not being made, much less...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 5, 2006
1:36 pm

Can someone please post an example of making and handling a WS call in Cairngorm 2? Is a Delegate required? Thanks, Ben ... makeObjectsBindable="false"...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 5, 2006
5:56 pm

Required, no, encouraged, yes. You have a public webservice I can call? I can make an example, but don't know of a public one. ... From: "ben.clinkinbeard"...
JesterXL
jesterxl@...
Send Email
Jul 5, 2006
6:18 pm

Sure, here is a simple call to Amazon's ItemSearch method. I emailed you my access key b/c I am a little hesitant to post it out here. <mx:WebService id="ws"...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Jul 5, 2006
6:33 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help