Getting server endpoint

Just starting out? Need help? Post your questions and find answers here.
kns
Posts: 1
Joined: Sun Sep 28, 2014 3:24 am

Getting server endpoint

Post by kns »

Hi,

In part, my question is asked at Stackoverflow,

http://stackoverflow.com/questions/7304 ... pplication

Essentially, my application must get the server/portal address then send three strings at the end of the run, as well as retrieve a few variables. My understanding is that this is typically completed with HttpRequest/GET/POST if one wants to hard code the URL. My naive question is, how does one get the "server endpoint"? I have the following flex code as an example while a PB solution would be most appreciated - free or paid.

Code: Select all


//data is called back using httppost in the mxml

<mx:HTTPService id="EndpointService" url="{endPointUrl}" 
	method="POST" resultFormat="text"
    	result="resultHandler(event)" fault="faultHandler(event)"></mx:HTTPService>

//called in the action script as 

function CallBack(score1:String, score2:String, score3:String):void
				{

			TPanel.setVisible(false);	
			//callback code here
			// Params object
			var params:Object = {};
			params["score1"] 	= score1;
			params["score2"] = score2;
			params["score3"] 	= score3;
                        //callback to container for stand alone platforms
			fscommand("","score1=" + score1 + " score2=" + score2 + " score3=" + score3);
			// Send params to end point for remote server/ browser deployment
			EndpointService.send(params);
		}		


//with results and faults used to control navigation or repeat callback


function resultHandler(e:Event):void
{
//if result is confirmed navigate to the next page
//navigateToURL(new URLRequest(_finalButtonUrl), '_parent');
theStack.selectedIndex=3; // change the stack order
NavigateButton.setVisible(true);
}


function faultHandler(e:Event):void
{
//if data bounces repeat the callback
CallBack("0", "null", OutputString);
}