I've been trying to find the right configuration for supporting both http/s requests in a Flex app. I've read all the docs and they allude to doing something like the following:
<default-channels>
<channel ref="my-secure-amf">
<serialization>
<log-property-errors>true</log-property-errors>
</serialization>
</channel>
<channel ref="my-amf">
<serialization>
<log-property-errors>true</log-property-errors>
</serialization>
</channel>
This works great when hitting the app via https but get intermittent communication failures when hitting the same app via http. Here's an abbreviated services-config.xml:
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<!-- HTTPS requests don't work on IE when pragma "no-cache" headers are set so you need to set the add-no-cache-headers property to false -->
<add-no-cache-headers>false</add-no-cache-headers>
<!-- Use to limit the client channel's connect attempt to the specified time interval. -->
<connect-timeout-seconds>10</connect-timeout-seconds>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<!--<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>-->
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<connect-timeout-seconds>10</connect-timeout-seconds>
</properties>
</channel-definition>
I'm running with Tomcat 5.5.17 and Java 5.
Thanks in advance for answers.
I have http and https working, although I've only tested it on Firefox and IE7. So far, I'm only using BlazeDS for remoting. Here is my set up:
<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint" />
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
<endpoint
url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.SecureAMFEndpoint" />
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
You don't specify the app server you're using; it may be an issue. I had some issues when switching from HTTPS to HTTP (secure logins) under Tomcat. One thing I did to troubleshoot was install Jetty and try it there. I'd never used it before, but it was very quick to set up and deploy to, even through Eclipse. I then knew I had a Tomcat specific-problem, which made finding a solution easier (by which I mean possible).