title: Flash Builder (Mobile) - Dynamic Web Service URL
body: <p>For my Flash Builder 4.6 Project I have a http service defined which looks at a url from our website. </p>
  
  <p>What I'd like to be able to do though is to change the web service url on the fly within the app. i.e. using the existing url as default but having an admin/settings screen to change where the web service points (either stored in our sqlite database or in local memory). </p>
  
  <p>This would be so that we could allow our customers to host their own version of the website/database but still be able to use/download the app through the app stores.</p>
  
  <p>Has anyone had any experience with doing this?</p>
  
  <p>EDIT: Adding some more details after the comments below.</p>
  
  <p>When I created the HTTP Service through the FlashBuilder wizard it creates two web service classes a super class and a sub class which inherits from the super class. All of the code that the wizard populates goes into the super class.</p>
  
  <p>I can assume that the code I need to put in would be in the sub class. But I do not know which function I'd put it in or how.</p>
  
  <p>Below is a sample of the Super's constructor:</p>
  
  <pre><code>// initialize service control
      _serviceControl = new mx.rpc.http.HTTPMultiService("websitehere");
       var operations:Array = new Array();
       var operation:mx.rpc.http.Operation;
       var argsArray:Array;
  
       operation = new mx.rpc.http.Operation(null, "loginRequest");
       operation.url = "login.php";
       operation.method = "GET";
       argsArray = new Array("un","pw");
       operation.argumentNames = argsArray;         
       operation.serializationFilter = serializer0;
       operation.properties = new Object();
       operation.properties["xPath"] = "/";
       operation.contentType = "application/x-www-form-urlencoded";
       operation.resultType = valueObjects.Data;
       operations.push(operation);
  _serviceControl.operationList = operations;  
  </code></pre>
  
  <p>I'm not sure what property of the _serviceControl variable I would need to alter. </p>
  
  <p>Also when I search for my website in my code it brings back a .fml file inside a .model directory which seems to get auto refreshed if I change the service url through the wizard. Would this not cause an issue?</p>
  
  <p>I then have the challenge of accessing the user defined url. Within the app we use an sqlite database to store data but I think it would probably be better to use a 'SharedObject' which we also use to know what account they are logged into. How reliable is this? I assume I would be able to access this via the Service? </p>
  
  <p>Though the awkward thing is that we were planning to have this configurable on a settings screen that would have been accessed after logging in. But to log in it would already need to know which server to point to. </p>