0 Replies Latest reply on Jul 7, 2007 2:59 PM by brado77

    Flex WebService redundant WSDL loading?

    brado77 Level 1
      I just ran a test on a WebService object, where after I loaded a WSDL, I invoked the getOperation() method on the WebService twice, and compared the two operations for equality. Both reference s returned turned out to be references to the same operation object.

      This seems to create a bit of imposed inefficiency in using web services. If I perform a web service call on an Operation object, any event handlers registered with that Operation will be invoked. But since the getOperation() method on the WebService returns the same Operation instance, this means that you cannot send two web service calls across the same operation on the same web service object that have different handlers, or else each handler will get both events that fire from the calls. In other words, if I have one part of my application that needs a WebService X, and another part of my application that needs a WebService X, then two seprate instances of the WebService will have to be created, and the WebService wsdl will have to be loaded for each instance. Furthermore, inside each part of the app holding onto a WebService instance, that application component must necessarily ensure that a web service call to Operation Y completes before Operation Y is called again, otherwise, the same problem occurs.

      Unless I am missing something, this seems a bit of a mess. Imagine an application where there's a WebService with a getCustomer() operation, and this web service needs to be called twice repeatedly, with different parameters. This requires loading the wsdl twice when it is only needed once, and furthermore requires religious disabling/enabling of buttons that initiate such a service, so that two calls don't cross the same operation.

      Hopefully someone can enlighten me on something I'm missing here. It seems that a WebService object design where the WebService wsdl is loaded once, and new Operation instances could be created would be much more optimal. Perhaps someone knows of some technique I haven't stumbled across yet.

      I'm all ears...Adobe...? :-)