I will have to think about this for v2.0 of my app.

- Kelly 

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Hoff
Sent: Thursday, June 29, 2006 1:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Embedding WSDL?

I hear you Kelly,

It sounds like its too late in the game to refactor your application.  But,
the Cairngorm micro-architecture would work nicely for this.  Components use
delegate classes that call a single data service class. Instantiated
components create an instance of the delegate, that has an asyncronous event
listening mechanism that links to the instance of the component.  This
allows for multiple components to go about thier own business, without
affecting each other.  Just another .02.  Good luck with your solution.

-TH


--- In flexcoders@yahoogroups.com, "Kelly Birr" <[EMAIL PROTECTED]> wrote:
>
> Tim,
> 
> I agree that actually embedding the WSDL may not be a good idea
but I am
> still hoping to find a way to pre-load the WSDL for the service
into a
> string the first time the service is called and then directly
insert that
> into the service every time the component is instantiated.
> 
> My application is a CRM system that works by creating and
destroying "pages"
> that are self contained.  Every time a contact is loaded it
creates a new
> instance of a "ContactPage" component and programmatically adds
that to a
> custom "TabNaivgator" control to give a tabbed user interface that
allow for
> multiple open contacts.  When they close a contact
the "ContactPage"
> instance is destroyed.
> 
> The real pain is that this pages uses two web services that each
must load
> their WSDl each time a contact is opened.  Now you see why I want
to find a
> way to load it once and then just hand the WSDL xml directly to
the web
> service object.  Having a single webservice object would be
unmanageable
> because I'd have to know what component instance to send the
result events
> to.  Not to mention that multiple "ContactPages" can be making
request at
> the same time.
> 
> I'm going to keep working on finding a way to accomplish this and
I'll let
> the group know what I find out.  If anyone from Adobe can give me
a hint in
> the right direction that would be excellent.  I'm also going to
keep
> investigation Andrew's method.
> 
> - Kelly
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> Behalf Of Tim Hoff
> Sent: Thursday, June 29, 2006 12:10 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Embedding WSDL?
> 
> That was my first thought Andrew, but I couldn't find the API to
ovverride.
> Anyways, at the end of the day, embedding wsdl isn't generally a
good idea.
> If you make a change to a webservice operation on the server side,
you would
> have to re-compile and re- deploy every Flex application that uses
it.
> Otherwise the applications would break.  There goes the
encapsulation.  The
> extra second or two needed to get the wsdl dynamically is
acceptable
> overhead if webservices is the chosen RPC.
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "Andrew Trice" <andrew.trice@>
> wrote:
> >
> > In Flex 1.5, I was able to preload/embed wsdl into the swf by
> overriding
> > the sendAndLoad method of the native XML object...
> > 
> >  
> > 
> > Take a look at my blog posting here to see how:  
> > 
> > https://www.cynergysystems.com/blogs/page/andrewtrice?
> entry=override_nat
> > ive_object_methods_in
> > 
> >  
> > 
> > I don't think that this exact syntax will work in Flex 2 b/c you
> can no
> > longer modify the prototype of a native object.    In Flex 2, 
you 
> could
> > try extending the WebService object like this (although I have
no 
> > guarantee that this would work... I have not actually tried it).
> Use
> > the EmbededWSDL class instead of the WebService class.  You might
> also
> > need to override the loadWsdl function.
> > 
> >  
> > 
> > package
> > 
> > {
> > 
> >             import mx.rpc.soap.WebService;
> > 
> >  
> > 
> >             public class EmbededWSDL extends WebService
> > 
> >             {
> > 
> >                         
> > 
> >                         public function EmbededWSDL(){
> > 
> >                                     
> > 
> >                                     this.wsdl = "MY WSDL STRING";
> > 
> >                                     super();
> > 
> >                         }
> > 
> >                         
> > 
> >             }
> > 
> > }
> > 
> >  
> > 
> >  
> > 
> > Hope that helps!
> > 
> > -Andy
> > 
> >  
> > 
> > _____________________________________
> > 
> > Andrew Trice
> > 
> > Cynergy Systems, Inc.
> > 
> > http://www.cynergysystems.com
> > 
> >  
> > 
> > Blog: http://www.cynergysystems.com/blogs/page/andrewtrice
> > 
> > Email: andrew.trice@
> > 
> > Office: 866-CYNERGY
> > 
> >  
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of Tim Hoff
> > Sent: Thursday, June 29, 2006 4:16 AM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Re: Embedding WSDL?
> > 
> >  
> > 
> > Kelly,
> > 
> > As Matt observed, I'm using a single AS class (Cairngorm
> ServiceLocator)
> > for webservice calls.  It's based on Jeff Tapper's DataManager
> class:
> > 
> > http://jeff.mxdj.com/as3datamanagerfix.htm
> > 
> > I changed the logic to get the wsdl, when the application loads,
> to cut
> > a few seconds off of the initial data call.  It appears that once
> the
> > wsdl is loaded, the webservice doesn't request it again for
> subsequent
> > calls.  If all of your calls are to the same webservice, there
> would
> > only be one request for the wsdl.  This would address your
client's 
> > concern about network traffic.
> > 
> > -TH
> > 
> > Note: You don't have to use AS.  The same thing can be done with
> mxml.
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "Kelly Birr" <kelly.fx@>
wrote:
> > >
> > > thanks, I'll have to somehow centralize my web services into
one
> > component,
> > > and find a way to mange getting the result events to the
correct
> place
> > > depending on what the user is doing.
> > > 
> > > - Kelly
> > > 
> > > _____
> > > 
> > > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED]
> > On
> > > Behalf Of Matt Chotin
> > > Sent: Thursday, June 29, 2006 12:06 AM
> > > To: flexcoders@yahoogroups.com
> > > Subject: RE: [flexcoders] Re: Embedding WSDL?
> > > 
> > > 
> > > 
> > > We don't have WSDL caching right now. It sounds like your app
> may call
> > for
> > > a strategy like a ServiceLocator where you put the WebService
in
> a
> > single
> > > location and refer to it from elsewhere. If you have 15
> WebService
> > tags you
> > > will get 15 WSDL requests even if they are for the same WSDL. 
So
> two
> > tags,
> > > less of a deal, 15, big pain. The DataServices approach that
Tim
> has
> > here
> > > is one example of a ServiceLocator.
> > > 
> > > 
> > > 
> > > Matt
> > > 
> > > 
> > > 
> > > _____
> > > 
> > > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED]
> > On
> > > Behalf Of Tim Hoff
> > > Sent: Wednesday, June 28, 2006 9:49 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Re: Embedding WSDL?
> > > 
> > > 
> > > 
> > > I have the same question as Kelly. It seems that the initial
> call
> > > to a webservice is slower because of the wsdl. Subsequent calls
> are
> > > fine, but there is always an initial delay. I know, switch to 
> > > HTTPService or RemoteObject.
> > > 
> > > For the following code, I'm thinking that I could override the
> > > loadWSDL() function, but the mx.rpc.soap.WebService API
doesn't 
> > > appear in the framework. Is the API final? Is there a work-
> around
> > > here?
> > > 
> > > public function DataServices(pri:PrivateClass, wsdl:String) { 
> > > this.ws = new WebService(); ws.wsdl = wsdl; ws.loadWSDL(); 
> > > ws.useProxy = false; ws.makeObjectsBindable = false; }
> > > 
> > > Thank you,
> > > -TH
> > > 
> > > --- In [EMAIL PROTECTED] <mailto:flexcoders%
40yahoogroups.com>
> > ups.com,
> > > "Kelly Birr" kelly.fx@ wrote:
> > > >
> > > > Is it possible to somehow embed WSDL in the compiled SWF, or
> > > read/write the
> > > > actual WSDL directly to the web services without them having
> to
> > > request it
> > > > via HTTP at runtime? Can I bind the WSDL to a string that I
> > > manually
> > > > request via UrlLoader?
> > > > 
> > > > Along with that if I have 15 different web service tags on
> > > different MXML
> > > > components of my application that all call the same web
> service
> > > with the
> > > > exact same WSDL Uri, will the WSDL cache? or will each Web
> Service
> > > instance
> > > > make a request for the WSDL via HTTP when it is initialized.
> > > > 
> > > > My client is very concerned that the application may be
> > > too "chatty" on
> > > > their network and it seems that these WSDL requests may be
> part of
> > > the
> > > > problem. I'm using Flex 2.0 RTM.
> > > > 
> > > > - Kelly
> > > >
> > >
> >
> 
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%
40yahoogroups.com
> Yahoo! Groups Links
>






------------------------ Yahoo! Groups Sponsor --------------------~--> See
what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to