How to dynamically assign WSDL url for webservice

Dear Experts,

I am trying to dynamically assign WSDl for webservice using a global variable.
eg:

<s:WebService id="wsAcquisitionAsset" wsdl="{service}">
                  
                  <s:operation name="CompareDates" resultFormat="object" result="CompareDates(event)"/>
                  <s:operation name="GetYearDepCalculatedBoth" resultFormat="object" result="GetYearDepCalculatedBoth(event)"/>      
            </s:WebService>




[Bindable]
public var service:String="http://localhost/AssetManagementWS/Webservice.asmx?wsdl";


variable service is initailized on creation complete but when i run my program it is not showing in my network monitor ( webservice is not called).

If i am Statically assigning value to WSDL then my webservice is called successfully.
LVL 2
RakeshBhandariAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

multiakiCommented:
I had the same problem with service URL.  
what i did is explicitly sat URL to service before executing it.

for example give unique ID to WebService.
then write UniqueID.send();
and in Fault event trace UniqueID.wsdl;
It might work.

And all the time if you have a dynamic value problem trace it on every stage and you will see where it has chnaged value.

create function called Debug('All')// URL, Variable, etc

 
private function debug(_str:String){
  switch (_str){
    case 'All':
      trace('Url = ' + webserivice.wsdl);
       etc;

    case 'URL':
      trace('URL = ' + webserivice.wsdl);
  }
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.