How to support both HTTP and HTTPS channels in Flex/BlazeDS?
Posted
by digitalsanctum
on Stack Overflow
See other posts from Stack Overflow
or by digitalsanctum
Published on 2009-06-17T21:42:44Z
Indexed on
2010/04/14
11:53 UTC
Read the original article
Hit count: 823
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.
- The BlazeDS docs say this is the best practice. Is there a better way?
- With this config, there seems to be 2-3 retries associated with each channel defined in the default-channels element so it always takes ~20s before the my-amf channel connects via a http request. Is there a way to override the 2-3 retries to say, 1 retry for each channel?
Thanks in advance for answers.
© Stack Overflow or respective owner