Have Flex WebServices share a common wsdl
I have a flex app that loads a WSDL at runtime and shares that across several different web services I have defined. Unfortunately each call to loadWSDL()
makes a network request for it, and while it's not really a problem due to caching it's still annoying and wasteful to have all those requests generated. Is there a simpler way to solve this problem and only make one network request?
My code is currently like:
var services:Array = ['service1', 'service2', ...]
for each (var name:String in servic开发者_StackOverflow社区es) {
var s:WebService = ServiceLocator.getInstance().getService(name) as WebService;
s.wsdl = wsdl;
s.loadWSDL();
}
Any help will be appreciated.
If the interface of each WSDL loaded is different from each other (i.e. They have different web operations), then you have no choice than to load each interface/WSDL individually. They need to be cached on the client side so your application has means to type the attributes and functions that represent the webservices.
You would be really doing a dis-service to yourself if your loading a wsdl and your client side code is not even invoking anything on it.
精彩评论