I am trying to run an adobe flex based application outside browser. Application is compiled using 'services-config.xml' file as parameter. In services-config.xml file the channels were configured as
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="http://{server.host}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<polling-enabled>true</polling-enabled>
<polling-interval-millis>0</polling-interval-millis>
<wait-interval-millis>-1</wait-interval-millis>
<max-waiting-poll-requests>0</max-waiting-poll-requests>
</properties>
</channel-definition>
and so on to pick host and port dynamically.
Now I have downloaded adobe_content_debugger.exe which allows me to run .swf file outside browser. However all the requests that are made to server go to http://localhost/contextRoot/messagebroker/amf. The {server.host} is picked up as localhost and {server.port} as empty value. Hence I cannot interact with backend server. How can we overcome this problem ?
Solutions I tried... 1) https://www.adobe.com/devnet/livecycle/articles/externalize_serviceconfig.html This post asks you programatically create AMFChannel/channelset and add it to RemoteObject.
var channel:AMFChannel = new AMFChannel("my-amf", amfEndpoint); channelSet.addChannel(channel); _serviceControl.channelSet = channelSet; _serviceControl.channelSet.addChannel(channel);
where _serviceControl is the remoteObject. But even after this the request is made to http://localhost/contextRoot/messagebroker/amf. I tried multiple combinations but only in vain. Will programatically creating channelSet make settings comming from services-config file redundant ? services-config file refers other files like 'remoting-config.xml', 'proxy-config.xml', 'messaging-config.xml' which contains information on 'destinations'
Solution 2) Change services-config.xml as
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="http://example.com/8556/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<polling-enabled>true</polling-enabled>
<polling-interval-millis>0</polling-interval-millis>
<wait-interval-millis>-1</wait-interval-millis>
<max-waiting-poll-requests>0</max-waiting-poll-requests>
</properties>
</channel-definition>
Then just map example.com to server IP in host file. This is a workaround but now the port is hard-coded and cannot be changed. Unless a proxy server is introduced.
Can someone help ?