<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sproif.com &#187; SecureAMFChannel</title>
	<atom:link href="http://sproif.com/tag/secureamfchannel/feed/" rel="self" type="application/rss+xml" />
	<link>http://sproif.com</link>
	<description>Everything you never wanted to read about... and less!</description>
	<lastBuildDate>Wed, 15 Jul 2009 12:10:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Granite SecureAMFChannel &#8211; AMF over HTTPS</title>
		<link>http://sproif.com/2009/03/15/granite-secureamfchannel-amf-over-https/</link>
		<comments>http://sproif.com/2009/03/15/granite-secureamfchannel-amf-over-https/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 15:36:52 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Technical Jargon]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[GraniteDS]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[SecureAMFChannel]]></category>
		<category><![CDATA[Tide]]></category>

		<guid isPermaLink="false">http://sproif.com/?p=88</guid>
		<description><![CDATA[How to test a flex/seam project locally with HTTP and post to HTTPS]]></description>
			<content:encoded><![CDATA[<p>At work we&#8217;ve started to use JBoss, writing an application in Java and AS 3.0.  We&#8217;re using Seam and Tide to sandwich it all together, and we came upon a slight problem.  Everything worked out great in the test environment, but when we went live, on an HTTPS connection, firebug was reporting that the AMF request out of flex was failing.  That&#8217;s due to the services-config.xml in the application pointing to a non-secure connection.  After much digging, we found this to be the solution.</p>
<p>WEB-INF/flex/services-config.xml<br />
in the channels definition at the top:</p>
<pre>
<pre class="brush: xml;">
&lt;channels&gt;
    &lt;!--USED IN THE LIVE ENVIRONMENT--&gt;
          &lt;!--channel ref=&quot;my-graniteamf-secure&quot;/--&gt;
    &lt;!--USED IN THE LOCAL/DEV ENVIRONMENT--&gt;
          &lt;channel ref=&quot;my-graniteamf&quot;/&gt;
&lt;/channels&gt;
</pre>
</pre>
<p>Then in the channel definition below we have both definitions:</p>
<pre>
<pre class="brush: xml;">
&lt;channel-definition id=&quot;my-graniteamf&quot;
	class=&quot;mx.messaging.channels.AMFChannel&quot;&gt;
	&lt;endpoint
		uri=&quot;http://{server.name}:{server.port}/{context.root}/graniteamf/amf&quot;
		class=&quot;flex.messaging.endpoints.AMFEndpoint&quot; /&gt;
&lt;/channel-definition&gt;
&lt;channel-definition id=&quot;my-graniteamf-secure&quot;
	class=&quot;mx.messaging.channels.SecureAMFChannel&quot;&gt;
	&lt;endpoint
		uri=&quot;https://{server.name}:443/{context.root}/graniteamf/amf&quot;
		class=&quot;flex.messaging.endpoints.SecureAMFEndpoint&quot; /&gt;
&lt;/channel-definition&gt;
</pre>
</pre>
<p>Click Here to Download: <a title="services-config.xml" rel="attachment wp-att-93" href="http://sproif.com/2009/03/15/granite-secureamfchannel-amf-over-https/services-config/">services-config.xml</a></p>
<p>We couldn&#8217;t get {server.port} to work correctly, so we&#8217;re forcing the port in the address for now.</p>
<p>The only problem with this is you have to remember to switch the AMF channel before deploying.  It&#8217;s on our checklist before doing the full deploy, but we&#8217;re most likely going to add it to the ant task list to deploy dev, deploy live.  Something like that.</p>
<p>The <strong>KEY THING TO REMEMBER</strong> is this: although this file is deployed with the war/ear, it is <em><strong>ALSO COMPILED INTO THE APPLICATION SWF</strong></em> when it is built.  Make sure to change it locally and rebuild your swf before posting, or you will see no change in your app. (found this out after a significant amount of time changing the file on the server to no avail&#8230;)</p>
<pre>(Ref: <a href="http://www.mail-archive.com/discussion@affug.com/msg00605.html" target="_blank">http://www.mail-archive.com/discussion@affug.com/msg00605.html</a>)</pre>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsproif.com%2F2009%2F03%2F15%2Fgranite-secureamfchannel-amf-over-https%2F&amp;title=Granite+SecureAMFChannel+%26%238211%3B+AMF+over+HTTPS" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://sproif.com/2009/03/15/granite-secureamfchannel-amf-over-https/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
