Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>We use an Application subclass that offers the following methods :</p> <pre><code> /** * The URI of the AMF channel endpoint. &lt;br/&gt; * Default to #rootURI + #channelEndPointContext + #this.channelEndPointPathInfo */ public function get channelEndPointURI() : String { return this.rootServerURI + ( this.channelEndPointContext ? this.channelEndPointContext : "" ) + this.channelEndPointPathInfo } /** * The root URI (that is scheme + hierarchical part) of the server the application * will connect to. &lt;br/&gt; * If the application is executing locally, this is the #localServerRootURI. &lt;br/&gt; * Else it is determined from the application #url. &lt;br/&gt; */ public function get rootServerURI() : String { var result : String = "" if ( this.url &amp;&amp; ( this.url.indexOf("file:/") == -1 ) ) { var uri : URI = new URI( this.url ) result = uri.scheme + "://" + uri.authority + ":" + uri.port } else { result = this.localServerRootURI } return result } </code></pre> <p>This generic application supports the <code>channelEndPointContext</code>, <code>channelEndPointPathInfo</code> and <code>localServerRootURI</code> properties (typically "mycontext" and "/messagebroker/amf/" in your example, the local server root being used when the application is executed via Flex Builder, in such cases it has a <code>file://</code> URL). <br/> The determination of the complete endpoint URI is then performed using either the <code>localServerRootURI</code> property or using the application <code>url</code> as our services are exposed by the very same server that serves the application's SWF (which is, as far as I understand your case too).</p> <p>So, in your example, one would write :</p> <pre><code> &lt;SuperApplication ...&gt; &lt;!-- SuperApplication is the enhanced Application subclass --&gt; &lt;mx:HTTPService id="myHTTPService" url="{this.channelEndPointURI}"/&gt; &lt;/SuperApplication&gt; </code></pre> <p>Starting from here, one can also automatically determine the <code>channelEndPointContext</code> from the application URL instead of hardcoding it as shown in this example.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload