3 Replies Latest reply on May 24, 2007 12:20 PM by schjlatah

    Loading a same Webservice twice

    babo_ya Level 3
      I have an application that creates two objects fo WebService class loading the same WSDL.
      Let's say it takes about 5 seconds to load the first one then doesn't the second should load faster since it is loaded?
      but, it looks like the second object takes about 5 seconds too.

      Is there anyway I can make the second instance of Webservice load faster?

      Thanks,
        • 1. Re: Loading a same Webservice twice
          ClownBootz
          why would you want to load the same webservice twice ... why wouldn't you put the first connection in a proxy in a delegate and just reuse it?
          • 2. Re: Loading a same Webservice twice
            schjlatah
            I do very similar things, and the answer to your question (why would you load the same webservice twice) is because I'm a bad programmer, and I don't know how to do it the right way.
            • 3. Loading a same Webservice twice
              schjlatah Level 1
              I still don't understand what ClownBootz is asking you to do, but I got the whole "multiple operations / result handlers from one WebService component" thing to work. You do have to explicitly set up what operations are allowed to the WebService, and then specify what resultHandler you want for that operation. Like this:

              <mx:WebService id="service" wsdl="someWSDLURL">
              <operation name="function1" result="function1ResultHandler(event)"/>
              <operation name="function2" result="function2ResultHandler(event)"/>
              </mx:WebService>

              then you could just access service.function1(variables, variables); and handle its result differently than you would the results from service.function2();

              Maybe something like this will help you out. I don't know if that is would solve your problem of having to load the same WebService twice, but it did for me.