<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Smalltalk in The Cloud</title>
	<atom:link href="http://blog.doit.st/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.doit.st</link>
	<description>Stuff related to Smalltalk and Cloud computing</description>
	<lastBuildDate>Tue, 31 Aug 2010 20:45:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.doit.st' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/b7c7b4f33ed8af23c6f08b2c9f4b3328?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Smalltalk in The Cloud</title>
		<link>http://blog.doit.st</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.doit.st/osd.xml" title="Smalltalk in The Cloud" />
	<atom:link rel='hub' href='http://blog.doit.st/?pushpress=hub'/>
		<item>
		<title>A new public EC2 AMI with Smalltalk and Seaside</title>
		<link>http://blog.doit.st/2010/08/29/a-new-public-ec2-ami-with-smalltalk-and-seaside/</link>
		<comments>http://blog.doit.st/2010/08/29/a-new-public-ec2-ami-with-smalltalk-and-seaside/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 21:32:08 +0000</pubDate>
		<dc:creator>Jan van de Sandt</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[pharo]]></category>
		<category><![CDATA[seaside]]></category>
		<category><![CDATA[squeak]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=330</guid>
		<description><![CDATA[This weekend I created a public Amazon Machine Image (AMI) setup as a Smalltalk web server with a Linux SqueakVM, a Pharo 1.1 Smalltalk image and the Apache2 web server. Anyone can use this AMI as a robust and scalable runtime platform for their Seaside applications. In this article I will try to explain how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=330&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This weekend I created a public Amazon Machine Image (AMI) setup as a Smalltalk web server with a Linux SqueakVM, a Pharo 1.1 Smalltalk image and the Apache2 web server. Anyone can use this AMI as a robust and scalable runtime platform for their Seaside applications.</p>
<p>In this article I will try to explain how you can you can use and customize this image. First their are some prerequisites:</p>
<ul>
<li>You need an Amazon AWS account and you should sign up for the <a href="http://aws.amazon.com/ec2/">Elastic Compute Cloud (EC2)</a> service.</li>
</ul>
<p>Using EC2 is not free, you have to pay for each hour the server runs and you have to pay for storage and bandwidth. Seaside runs fine on the smallest 32bit AMI that costs $0,085 cents per hour. Bandwidth is $0,15 per GB (the first GB is free).  You can get a discount on the costs per hour if you reserve you AMI&#8217;s beforehand.</p>
<p>The AMI is based on a <a href="http://uec-images.ubuntu.com/releases/10.04/release/">32bit Ubuntu 10.04 server AMI</a>. The Ubuntu server is a very minimal install, I have added Apache2 and the SqueakVM. I have also setup a <a href="http://pharo-project.org/">Pharo image</a> with the <a href="http://www.seaside.st/">Seaside</a> runtime packages and Apache2 is configured in such a way that all requests are forwarded to Seaside.</p>
<p>How can you start using this AMI?</p>
<p>Start an EC2 instance using the public AMI ami-0800ea61 (ubuntu-10.04-i386-smalltalk-server-v01). The AMI is available in the US East region. This is the cheapest region <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  When you start the image you have to select a security group. This defines the firewall rules for the AMI. You can select the default group or some other group that allows TCP connections for the ports 22 and 80.</p>
<p>When the image is started it should have a generated a public DNS name. When you enter this name in the address bar of your browser, you should see something similar to <a href="http://ec2demo.doit.st">http://ec2demo.doit.st</a> If the web page is shown it means that everything is running OK.</p>
<p>You can connect to the running AMI instance using ssh. You should login with the userid ubuntu. No password is required because a private key is used for authentication. The Pharo image that runs on the AMI includes RFB, a VNC server implementation. With a VNC client we can remotely control the Smalltalk image. The best way to do this is to tunnel the VNC connection (port 5900) through ssh:</p>
<p>ssh -i id_rsa-gsg-keypair -L 5900:localhost:5900 ubuntu@ec2demo.doit.st</p>
<p>Now you can connect to the image using a VNC client use display number 0 and the password is seaside. Note that you have to keep port 5900 closed for direct access otherwise this would be very unsecure.</p>
<p>Through the VNC client you have access to the Smalltalk image. You should see a workspace. I used the code in this workspace to build the image from a standard PharoCore 1.1 image. Note that I only loaded the runtime parts of Seaside and some small examples. This image is used for hosting an application and not for development so it is probably safer and more efficient to leave out the development packages.</p>
<p>If the image suits your needs you can just load your packages through Monticello. There is no config web application to configure your Seaside components. You can do this via the workspace or better, make a class side initialize method that does this automatically when the package is loaded. I used the the Apache2 configuration described in the <a href="http://book.seaside.st/book/advanced/deployment">Seaside book</a> (the non-clustered setup for now). You can read the Deployment chapter for more details. You should have you app running within a few minutes.</p>
<p>If the Smalltalk image does not suit your needs you can replace it with another Squeak or Pharo image. The image is stored in the directory /srv/seaside If your new image has a different name you need to update the run script in the same directory.</p>
<p>Of course you can also install more Ubuntu packages. You could install a local database system like MySQL or PostgreSQL. But if you are really into cloud computing you probably don&#8217;t want to maintain a database yourself. Instead you can use RDS, an AWS managed MySQL service or SimpleDB. SimpleDB is a key-value store with a simple API and great scalability. You can use the <a href="http://www.squeaksource.com/Cloudfork">Cloudfork ActiveItem</a> Smalltalk library to persist your Smalltalk objects to SimpleDB.</p>
<p>To setup a nice domain name for your app (like <a href="http://ec2demo.doit.st">ec2demo.doit.st</a>) you should reserve a static IP using the AWS Console. You can then go to your domain name registrar and update the name servers to point to this IP number.</p>
<p>Ok, this is about it. If you have questions or ideas on how to improve the Smalltalk AMI please let me now. I think the current AMI can be used as a production environment for Seaside apps.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=330&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2010/08/29/a-new-public-ec2-ami-with-smalltalk-and-seaside/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39f97e9c1b95363b4f3db5e120bf2c45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jvdsandt</media:title>
		</media:content>
	</item>
		<item>
		<title>Amazon AWS Region Endpoints in Europe</title>
		<link>http://blog.doit.st/2010/06/01/amazon-aws-region-endpoints-in-europe/</link>
		<comments>http://blog.doit.st/2010/06/01/amazon-aws-region-endpoints-in-europe/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 19:40:41 +0000</pubDate>
		<dc:creator>Ernest Micklei</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[amazon]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=312</guid>
		<description><![CDATA[To use the Cloudfork classes for services located in Europe (Ireland), you need to change the serviceUrl property such as: &#124;sdb&#124; sdb := CFSimpleDB new. sdb serviceUrl: 'http://sdb.eu-west-1.amazonaws.com' Service URL SimpleDB sdb.eu-west-1.amazonaws.com SQS eu-west-1.queue.amazonaws.com EC2 eu-west-1.ec2.amazonaws.com SNS sns.eu-west-1.amazonaws.com S3 Set Bucket location constraint to EU RDS rds.eu-west-1.amazonaws.com A comprehensive list can be found over at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=312&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To use the <a href="http://cloudfork.googlecode.com">Cloudfork</a> classes for services located in Europe (Ireland), you need to change the serviceUrl property such as:</p>
<pre class="brush: ruby;">
|sdb|
sdb := CFSimpleDB new.
sdb serviceUrl: 'http://sdb.eu-west-1.amazonaws.com'
</pre>
<table>
<tbody>
<tr>
<th>Service</th>
<th>URL</th>
</tr>
<tr>
<td>SimpleDB</td>
<td>sdb.eu-west-1.amazonaws.com</td>
</tr>
<tr>
<td>SQS</td>
<td>eu-west-1.queue.amazonaws.com</td>
</tr>
<tr>
<td>EC2</td>
<td>eu-west-1.ec2.amazonaws.com</td>
</tr>
<tr>
<td>SNS</td>
<td>sns.eu-west-1.amazonaws.com</td>
</tr>
<tr>
<td>S3</td>
<td>Set Bucket location constraint to EU</td>
</tr>
<tr>
<td>RDS</td>
<td>rds.eu-west-1.amazonaws.com</td>
</tr>
</tbody>
</table>
<p>A comprehensive list can be found over at <a href="http://www.elastician.com/2009/12/comprehensive-list-of-aws-endpoints.html">Elastician</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=312&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2010/06/01/amazon-aws-region-endpoints-in-europe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ae4660044c0bb7b590e3de213011a458?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emicklei</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing Cloudfork AWS SimpleDB based classes</title>
		<link>http://blog.doit.st/2009/09/20/testing-cloudfork-aws-simpledb-based-classes/</link>
		<comments>http://blog.doit.st/2009/09/20/testing-cloudfork-aws-simpledb-based-classes/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 19:53:43 +0000</pubDate>
		<dc:creator>Ernest Micklei</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[simpledb]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[unit]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=279</guid>
		<description><![CDATA[The Cloudfork framework includes an alternate implementation of CFSimpleBase that stores all items in memory. The CFSimpleDBEmulator was initially created to support the unit testing of the ActiveItem framework. With the exception of some query constructs, it implements the complete api and therefore is suitable for unit testing your own applications as well. &#124; emulator [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=279&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The Cloudfork framework includes an alternate implementation of CFSimpleBase that stores all items in memory. The CFSimpleDBEmulator was initially created to support the unit testing of the ActiveItem framework. With the exception of some query constructs, it implements the complete api and therefore is suitable for unit testing your own applications as well.</p>
<div style="border:1px solid #aaaaaa;background:#ffffff;padding-left:4px;padding-right:4px;">
<pre style="font-family:Helvetica;">
| emulator domain item |
emulator := CFSimpleDBEmulator new.
domain := (emulator createDomain: 'myapp.development') result.
item := CFSimpleDBItem newNamed: 'user.dennis'.
item valueAt: 'birthday' put: '20060916'  ;valueAt: 'hobby' put: 'soccer'.
domain putItem: item.
</pre>
</div>
<p>After running the tests, you can inspect the emulator to see what items have been stored in which domains and what attributes they have. If you store the emulator in some class var then you can keep the data around for development too.</p>
<p><strong>ActiveItem</strong><br />
Because the ActiveItem framework is build on top of SimpleDB, the same emulator class can be used to unit test those applications. ActiveItem uses a globally shared CFSimpleDB instance so you only need to replace that with an emulated instance. </p>
<div style="border:1px solid #aaaaaa;background:#ffffff;padding-left:4px;padding-right:4px;">
<pre style="font-family:Helvetica;">
CFActiveItem activateWithSimpleDB: CFSimpleDBEmulator new.
</pre>
</div>
<p>Using the CFActiveItemSerializer you can even dump the items to a local Filesystem for development convenience.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=279&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/09/20/testing-cloudfork-aws-simpledb-based-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ae4660044c0bb7b590e3de213011a458?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emicklei</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing WinCrypt for VA Smalltalk</title>
		<link>http://blog.doit.st/2009/07/10/introducing-wincrypt-for-va-smalltalk/</link>
		<comments>http://blog.doit.st/2009/07/10/introducing-wincrypt-for-va-smalltalk/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 11:45:40 +0000</pubDate>
		<dc:creator>Jan van de Sandt</dc:creator>
				<category><![CDATA[WinCrypt]]></category>
		<category><![CDATA[vasmalltalk]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=274</guid>
		<description><![CDATA[WinCrypt is a new library for VA Smalltalk on Windows. It makes part of the cryptography functionality that is shipped with the Windows OS easily available from Smalltalk. The following features are available in the initial version: Symmetric encryption and decryption using RC4, DES, TripleDES and AES-256 The MD5, SHA and SHA-256 hash functions The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=274&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WinCrypt is a new library for VA Smalltalk on Windows. It makes part of the cryptography functionality that is shipped with the Windows OS easily available from Smalltalk.</p>
<p>The following features are available in the initial version:</p>
<ul>
<li> Symmetric encryption and decryption using RC4, DES, TripleDES and AES-256</li>
<li> The MD5, SHA and SHA-256 hash functions</li>
<li> The HMAC-MD5, HMAC-SHA and HMAC-SHA-256 message authentication functions.</li>
</ul>
<p>The API is pretty simple to use. To encrypt a String or ByteArray using a password you can use the class methods defined in WinCryptCipher: </p>
<pre class="brush: ruby;">
| encryptedBytes |
encryptedBytes := WinCryptAES encrypt: 'my-dirty-little-secret' using: 'puppy'
</pre>
<p>The results is always a ByteArray. This ByteArray can be decrypted and converted to a String:</p>
<pre class="brush: ruby;">
| encryptedBytes decryptedBytes |
encryptedBytes := WinCryptAES encrypt: 'my-dirty-little-secret' using: 'puppy'.
decryptedBytes := WinCryptAES decrypt: encryptedBytes using: 'puppy'.
^decryptedBytes asString
</pre>
<p>The ciphers use a key with a specific size for encryption and decryption. When you provide a password string the key is derived from this password using the MD5 hash algorithm. It is also possible to skip this step and supply your own key.</p>
<p>The WinCrypt library is open source and is published on <a href="http://vastgoodies.com/maps/WinCrypt">VAStGoodies.com</a>. The included SUnit tests show how the library can be used. The underlying Windows functions are documented on <a href="http://msdn.microsoft.com/en-us/library/aa380255%28VS.85%29.aspx">MSDN</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/274/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=274&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/07/10/introducing-wincrypt-for-va-smalltalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39f97e9c1b95363b4f3db5e120bf2c45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jvdsandt</media:title>
		</media:content>
	</item>
		<item>
		<title>Secure access to AWS from VisualWorks</title>
		<link>http://blog.doit.st/2009/07/09/secure-access-to-aws-from-visualworks/</link>
		<comments>http://blog.doit.st/2009/07/09/secure-access-to-aws-from-visualworks/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 16:00:28 +0000</pubDate>
		<dc:creator>Ernest Micklei</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[authority]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[trust]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=263</guid>
		<description><![CDATA[Cloudfork implements the REST API of the Amazon Web Services using both secure (https) and non-secure (http) communication. In order to use the https protocol to access S3,SimpleDB,SQS or EC2, you need to prepare the Smalltalk image by registering a trusted certificate. Without that certificate, your application will produce an error saying &#8220;CA Not in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=263&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://cloudfork.googlecode.com">Cloudfork</a> implements the REST API of the Amazon Web Services using both secure (https) and non-secure (http) communication. In order to use the https protocol to access S3,SimpleDB,SQS or EC2, you need to prepare the Smalltalk image by registering a trusted certificate. Without that certificate, your application will produce an error saying &#8220;CA Not in Trust Registry!&#8221; (CA = Certificate Authority). The steps below describe how to register the correct certificate in a VisualWorks (or WebVelocity) image.</p>
<p><strong>Install HTTPS</strong><br />
Unless already loaded in your image, you need to install the HTTPS parcel (use Parcel Manager).</p>
<p><strong>Export Certificate</strong><br />
Amazon WebServices uses the following root certificate &#8220;VeriSign Class 3 Secure Server CA&#8221;. You can verify this by inspecting the chain object in the debugger that can be opened if you have a failed secure test.</p>
<p>One way to get this certificate file is to export it from the list of certificates known to your Internet Browser. For FireFox users, open Preferences&gt;Advanced&gt;Encryption&gt;View Certificates. Under VeriSign, Inc., select the certifcate, export it using the format &#8220;X.509 Certificate with chain (PEM)&#8221; and name it &#8220;VeriSignClass3SecureServerCA.pem&#8221;.</p>
<p><strong>Import Certificate</strong><br />
The following script will import the Base-64 encoded certificate file.</p>
<pre class="brush: ruby;">
| certificate registry |
registry := Security.X509.X509Registry default.
certificate := Security.X509.Certificate fromFile:'VeriSignClass3SecureServerCA.pem'.
registry addCertificate: certificate.
</pre>
<p>Please be aware of what is stated in the VisualWorks SecurityGuide.pdf (page 72): &#8220;Adding a CA certificate to your registry is deceivingly simple and does not convey the degree of trust actually involved in that action. Be sure to understand what it is you are trusting a CA to do and ensure that it matches the security requirements of your application.&#8221;</p>
<p><strong>Run the Tests</strong><br />
Results of the secure Cloudfork Integration tests should all be in the <span style="color:green;">green</span> now.<a href="http://cloudfork.googlecode.com"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=263&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/07/09/secure-access-to-aws-from-visualworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ae4660044c0bb7b590e3de213011a458?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emicklei</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing WinHttpClient for VA Smalltalk</title>
		<link>http://blog.doit.st/2009/06/17/introducing-winhttpclient-for-va-smalltalk/</link>
		<comments>http://blog.doit.st/2009/06/17/introducing-winhttpclient-for-va-smalltalk/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 15:26:50 +0000</pubDate>
		<dc:creator>Jan van de Sandt</dc:creator>
				<category><![CDATA[WinHttpClient]]></category>
		<category><![CDATA[vasmalltalk]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=246</guid>
		<description><![CDATA[WinHttpClient is a new HTTP client library for VA Smalltalk on Windows. This library uses a Windows DLL to perform the HTTP network operations. The DLL is called winhttp.dll and is available on all the current Windows platforms. Using this DLL all the features of the HTTP protocol can be used in an efficient way. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=246&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WinHttpClient is a new HTTP client library for VA Smalltalk on Windows. This library uses a Windows DLL to perform the HTTP network operations. The DLL is called winhttp.dll and is available on all the current Windows platforms. Using this DLL all the features of the HTTP protocol can be used in an efficient way. This includes support for secure (https) connections.</p>
<p>This is a first release of the Smalltalk library; in this release not all the features are available from Smalltalk yet. But all the common functionality can already be used:</p>
<ul>
<li> HTTP GET, POST and HEAD requests</li>
<li> Support for setting custom request headers and access to the response headers</li>
<li> Support for secure http (https) including support for client certificates</li>
<li> Streaming downloads and uploads</li>
<li> Proxy support</li>
<li> Server and proxy authentication support</li>
</ul>
<p>We developed this library because the standard HTTP client of VA Smalltalk is not fully stable on Windows when using secure connections on multi-core systems. Nationaal Spaarfonds (a part of Delta Lloyd Group) has a VA Smalltalk application in production that needs to call secure webservices. This works fine most of the time but sometimes causes the image to freeze. See the Instantiations forum for <a href="http://www.instantiations.com/forum/viewtopic.php?f=12&amp;t=2408">a discussion of this problem</a>.</p>
<p>WinHttpClient can be plugged into the VA Smalltalk webservice stack as a replacement for the standard HTTP client. Our stress tests show that the stability problems disappear after this switch.</p>
<p>The WinHttpClient library is open source and is available on <a href="http://vastgoodies.com/maps/WinHttpClient">VAStGoodies.com</a>. If you are interested please try it out. If you have suggestions on how we can improve the API we would love to hear them. Contributions to add missing features are also very welcome.</p>
<h2>WinHttpClient API</h2>
<p>The API is structured the same way as the Windows winhttp library. You can find the documentation on MSDN: <a href="http://msdn.microsoft.com/en-us/library/aa384273%28VS.85%29.aspx">http://msdn.microsoft.com/en-us/library/aa384273(VS.85).aspx</a></p>
<p>Important concepts are Session, Connection and Request. Before you can do anything with the library you need a Session instance:</p>
<pre class="brush: ruby;">
| session response |
session := WinHttpSession new.
response := session submitGetRequest:
	'http://en.wikipedia.org/wiki/Smalltalk'
</pre>
<p>The WinHttpSession class has a number of submitXXX methods. These methods create and send HTTP requests and handle the responses. They return an instance of WinHttpResponse, this object contains the HTTP status, the HTTP header information and the contents.</p>
<p>If the contents of the response is possibly very large than it is better to use a streaming variant of the submit request which has a write stream as an argument. This method will still answer a WinHttpResponse instance but the contents variable of this instance will be nil.</p>
<p>After you have finished with the session you should send “session release”. This is because the session object contains a handle to a Windows structure that must be freed to prevent memory leaks. The class side of WinHttpSession contains a number of convenience submit methods that handle the release message for you.</p>
<h3>WinHttpConnection</h3>
<p>If you need to send multiple requests to the same host it is more efficient to work with a connection object instead of a session:</p>
<pre class="brush: ruby;">
| session connection responses |
session := WinHttpSession new.
responses := OrderedCollection new.
connection := session connectTo: 'en.wikipedia.org'.
[
	responses
		add: (connection submitGetRequest: '/wiki/Smalltalk');
		add: (connection submitGetRequest: '/wiki/HTTP');
		add: (connection submitGetRequest: '/wiki/Virtual_machine')
] ensure: [ connection release ].
responses
</pre>
<h3>WinHttpRequest</h3>
<p>Normally you don’t need to work with requests objects directly, you can just use the submit methods of the session or connection objects. Only when you need to set special options you need to access the request object directly. An example of this is when you want to send a request to a secure web server with an invalid server certificate. The default behavior of winhttp is to refuse the connection and throw an error. For example, if you want to accept certificates with an unknown certificate authority you need to set the “IgnoreUnknowsCA” option:</p>
<pre class="brush: ruby;">
| url session connection request response |

url := 'https://www.securebutinvalid.com' sstAsUrl.
session := WinHttpSession new.
connection := session connectToUrl: url.

request := connection openGetRequest: url absolutePath.
request setSecurityOptionIgnoreUnknownCA.
request send.
response := request getResponse.

request release.
connection release.
session release.
response
</pre>
<p>Note that we think this part of the WinHttpClient API is a bit awkward. The intention is to improve this in future versions.</p>
<h3>Proxy support</h3>
<p>WinHttp has support for proxy’s and a number of proxy authentication methods (Basic, NTLM etc). When you instantiate a session you can specify the proxy to use or you can use the defaultProxy class methods to set a default for all sessions.</p>
<p>It is also possible to copy the proxy settings that are configured in Internet Explorer. Use initProxyInfoFromIE class method of the Session class for this.</p>
<p>For more examples on how to use WinHttpClient see the unit tests in WinHttpClientTestApp.</p>
<h2>Using WinHttpClient in the VA Webservice stack</h2>
<p>The application WinHttpClientWebServiceSupportApp contains classes that can replace the standard HTTP Client with WinHttpClient for calling webservices. Thanks to the flexible way that webservice support is implemented in VA Smalltalk this is quite easy to do. We just have to replace the default HTTP and HTTPS dispatchHandlers with a custom version. We can do this when we create the webservice container:</p>
<pre class="brush: ruby;">
| container httpHandler secureHttpHandler |

container := SstWSContainer containerNamed: 'test' ifNone: [ SstWSContainer createContainerNamed: 'test' ].

httpHandler := WinHttpDispatchHandler new.
secureHttpHandler := WinHttpDispatchHandler new.

container handlerFactory
	register: httpHandler named: 'wsHttpClientRequestHandler' inNamespace: container handlerFactory globalNamespace;
	register: secureHttpHandler named: 'wsHttpsClientRequestHandler' inNamespace: container handlerFactory globalNamespace.
container
</pre>
<p>For a full example see the test class WinHttpWeatherForecastTest.</p>
<h3>Secure webservices with client certificates</h3>
<p>Supporting secure webservices that use HTTPS was very easy with WinHttpClient. But adding support for client certificates involved a bit more work. To set a client certificate for a request another Windows DLL is required: crypt32.dll. This DLL is also shipped with all the current Windows platforms. This DLL contains the functionality to handle certificates and all kinds of secure hashing, encrypting and decrypting functionality. In the future we can make all this functionality available from Smalltalk in a separate project. Currently WinHttpClient uses just a few functions from this DLL to set the correct certificate for a request.</p>
<p>You can tell the WinHttpDispatchHandler to use a client certificate by calling the setter method clientCertificateFilename:. The file you provide must be in one of the supported formats by Microsoft and must contain bot the certificate and the private key.</p>
<p>In the old situation we had the certificate and the private key in two separate pem files. WinHttp cannot handle this. We used openssl to convert the two pem files into a single pfx file:</p>
<p><code>openssl pkcs12 -export -out testcert.pfx -inkey testcertrsa.pem -certfile testcert.pem</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=246&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/06/17/introducing-winhttpclient-for-va-smalltalk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39f97e9c1b95363b4f3db5e120bf2c45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jvdsandt</media:title>
		</media:content>
	</item>
		<item>
		<title>HTTP Clients for Squeak</title>
		<link>http://blog.doit.st/2009/05/25/http-clients-for-squeak/</link>
		<comments>http://blog.doit.st/2009/05/25/http-clients-for-squeak/#comments</comments>
		<pubDate>Mon, 25 May 2009 20:37:47 +0000</pubDate>
		<dc:creator>Jan van de Sandt</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[sqs]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[simpledb]]></category>
		<category><![CDATA[squeak]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[smalltalk]]></category>
		<category><![CDATA[pharo]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=239</guid>
		<description><![CDATA[Cloudfork-AWS makes the Amazon Web Services (AWS) S3, SQS and SimpleDB easily accessible from Smalltalk. All the communication between the Smalltalk image and AWS is done via HTTP. So a HTTP Client is an important requirement for Cloudfork-AWS. Cloudfork-AWS needs more than just handling simple HTTP GET and POST requests, the following features are also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=239&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Cloudfork-AWS makes the Amazon Web Services (AWS) S3, SQS and SimpleDB easily accessible from Smalltalk. All the communication between the Smalltalk image and AWS is done via HTTP. So a HTTP Client is an important requirement for Cloudfork-AWS.</p>
<p>Cloudfork-AWS needs more than just handling simple HTTP GET and POST requests, the following features are also needed:</p>
<ul>
<li>Setting custom request headers – S3 uses custom headers for authentication and for attaching meta-data to S3 objects. We need to be able to set these headers. This feature is also required for range requests, with these requests you can download a part of a S3 object instead of downloading the entire object.</li>
<li>Access to the response headers – So we can read the meta-data of S3 objects.</li>
<li>Support for PUT, HEAD and DELETE requests – Also required for S3. PUT is required for storing objects and creating buckets. DELETE is required for removing objects and HEAD for getting the object meta-data without downloading the object itself.</li>
<li>HTTPS support – The AWS services can be accessed via plain HTTP or via secure HTTPS. The choice is up to the client. But the <a href="http://docs.amazonwebservices.com/AmazonSimpleDB/2009-04-15/DeveloperGuide/index.html?WhatsNew.html">release notes</a> of the latest releases of SimpleDB mention that HTTP support will be deprecated and that future versions will require HTTPS.</li>
<li>HTTP/1.1 support – Not a must have feature but version 1.1 requests can be more efficient than version 1.0 requests because of the keep-alive feature of version 1.1. With this feature socket connections can be reused between requests.</li>
<li>Streaming uploads and downloads – Also not a must have feature for most use cases. Only when large s3 objects need to be handled.</li>
<li>Proxy support – Not a requirement of one of the AWS services but a feature that is often required by client configurations.</li>
</ul>
<p>Note that most of these features are only required for S3 and not for SQS and SimpleDB. SQS and SimpleDB only use GET and POST requests and the authentication is done in the URL and not through HTTP header fields. The HTTP responses of SQS and SimpleDB always contain XML and the maximum size is about 8KB for SQS and 1MB for a SimpleDB resultset so streaming support is not required.</p>
<p>As far as I know there are three HTTP clients available for Squeak:</p>
<ul>
<li>The HTTPSocket class – This class is part of the Network-Protocols package and is part of the standard images of the latest Squeak and Pharo versions.</li>
<li><a href="http://map.squeak.org/package/15f42ec1-e93e-4bcf-ab2b-6746ae9d413f">SWHTTPClient</a> – This is an extensive HTTP client library. It was originally developed for <a href="http://www.dolphinharbor.org/dh/projects/httpclient/index.html">Dolphin Smalltalk</a> and was ported to Squeak. The latest release is not fully compatible with the latest Squeak release. There are a number of class extension collisions.</li>
<li><a href="http://wiki.squeak.org/squeak/5865">CurlPlugin</a> – This is a Squeak plugin that uses the <a href="http://curl.haxx.se/libcurl/">libcurl </a>C library, libcurl is a well-known and powerful open source “URL transfer library” with support for HTTP, FTP and many other protocols.</li>
</ul>
<h3>HTTPSocket</h3>
<p>This is a very simple implementation of a HTTP client in a single class. HTTP GET and POST requests are supported, access to the headers is also possible and simple proxy configurations are also supported. HTTP version 1.1 is not supported, HTTPS is also not possible.</p>
<p>The current version of Cloudfork-AWS does not work with HTTPSocket as a HTTP client. With the provided functionality it should be possible to support the SQS and SimpleDB API’s. But when I use HTTPSocket I get an AWS error telling me that the signature calculated is wrong. I think this is because HTTPSocket always adds the port number to the host header field. Cloudfork doesn’t do this when it calculates the signature so you get a mismatch. It is on my todo list to fix this.</p>
<h3>SWHTTPClient</h3>
<p>SWHTTPClient is a full featured HTTP client library. It supports HTTP/1.1, access to the header fields and the PUT, HEAD and DELETE methods. Streaming uploads and downloads are also possible. The one thing that is not supported or that I couldn’t get working is HTTPS. Perhaps it’s possible to get this working by plugging in the <a href="http://www.squeaksource.com/Cryptography.html">Cryptography</a> package but I have no idea how.</p>
<p>Another issue is that SWHTTPClient is not fully compatible with the latest Squeak and Pharo releases. The package contains some class extensions that override exiting methods with different behavior. For example the String&gt;&gt;subStrings: method.</p>
<p>Cloudfork-AWS can use SWHTTPClient, all AWS features work except HTTPS. I have fixed all the incompatibilities I bumped into. The patched version of SWHTTPClient is available from the Cloudfork project page on SqueakSource.</p>
<h3>CurlPlugin</h3>
<p>The installation of this library is a bit more work. You need the place the correct binaries for your platform in the Squeak installation directory and load the <a href="http://www.squeaksource.com/CurlPlugin.html">CurlPlugin package</a> from SqueakSource. If you load the package you may get a warning that the class CurlPlugin cannot be loaded. This is no problem, you can still use the plugin through the Curl class. The CurlPlugin class is only needed if you want to create a new version of the plugin or support a new platform.</p>
<p>The libcurl library that the CurlPlugin uses supports all the HTTP features we need and many more. It is one of the bests HTTP client libraries around. And it’s open source. It has an optional integration with openssl which provides the functions required for HTTPS.</p>
<p>The current version of the CurlPlugin doesn’t expose all the features of libcurl. Currently HEAD and DELETE requests are not supported. It is also not yet possible to set the header fields for a requests. The other methods work very well and HTTPS also works fine.</p>
<h3>Cloudfork-AWS</h3>
<p>For the SimpleDB and SQS services the CurlPlugin is the best HTTP client. All the required features are there and the performance is very good. SimpleDB and SQS also work with the SWHTTPClient, only without HTTPS support. If the Curl class is present in your image Cloudfork-AWS will use this class for all SimpleDB and SQS service calls, otherwise the SWHTTPClient is used.</p>
<p>The current CurlPlugin doesn’t support all the features required by the S3 service. For this reason the Cloudfork S3 functionality requires the SWHTTPClient.</p>
<h3>Future work</h3>
<p>I think the CurlPlugin has the potential to become a very good HTTP client library for Squeak and Pharo. It will also be relatively easy to maintain this library because all of the complex work of supporting the different protocols is implemented in libcurl. This C library has a very large community and is well maintained. I will try to extend the plugin and add the missing features.</p>
<p>I will also try to make Cloudfork-AWS compatible with HTTPSocket. This will not be the best performing solution but it can be an easy starting point.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=239&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/05/25/http-clients-for-squeak/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39f97e9c1b95363b4f3db5e120bf2c45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jvdsandt</media:title>
		</media:content>
	</item>
		<item>
		<title>Composition relations in Cloudfork-ActiveItem</title>
		<link>http://blog.doit.st/2009/04/20/composition-relations-in-cloudfork-activeitem/</link>
		<comments>http://blog.doit.st/2009/04/20/composition-relations-in-cloudfork-activeitem/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 13:01:26 +0000</pubDate>
		<dc:creator>Ernest Micklei</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[activeitem]]></category>
		<category><![CDATA[assocication]]></category>
		<category><![CDATA[composition]]></category>
		<category><![CDATA[simpledb]]></category>
		<category><![CDATA[smalltalk]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=212</guid>
		<description><![CDATA[In UML, the composition relation between objects is a special association that is used to model a &#8220;private-container&#8221; relationship. The typical class-room example is the Car object having 4 Wheel objects. Although you can replace wheels on a car, one particular Wheel object is never shared with other Car objects. In Amazon SimpleDB there is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=212&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In UML, the composition relation between objects is a special association that is used to model a &#8220;private-container&#8221; relationship. The typical class-room example is the Car object having 4 Wheel objects. Although you can replace wheels on a car, one particular Wheel object is never shared with other Car objects.</p>
<p>In Amazon SimpleDB there is no concept of relations ; it is a simple storage of items having attributes (key-value pairs). The Cloudfork-ActiveItem framework can map these relations to foreignkey-like attributes but that should be used with care. Because SimpleDB is not a relational database, operations such as Joins are simply not possible. However, mapping the composition relation fits much better in the SimpleDB storage model. The notion of a SimpleDB item being a container of information is just what it is meant to be.</p>
<p>To illustrate how ActiveItem supports this design construct, I will give an example that models multiple-choice questions for an exam training application. A Question is a composition of 4 Choices ; one of them is the correct answer to that question.</p>
<pre class="brush: ruby;">
Question class&gt;&gt;describe: aQuestion

  aQuestion
    hasString: #code ;
    hasText: #text ;
    ownsMany: #choices
</pre>
<pre class="brush: ruby;">
Choice class&gt;&gt;describe: aChoice

  aChoice
    hasText: #text ;
    hasBoolean: #isAnswer
</pre>
<p>When saving a Question, ActiveItem will create one SimpleDB item with both the attributes of the Question and the attributes of each Choice:</p>
<pre class="brush: ruby;">
code -&gt; '010-0001'
text -&gt; 'What language is best for writing Web applications?'
choices.1.text -&gt; 'Java'
choices.1.isAnswer -&gt; 'false'
choices.2.text -&gt; 'Ruby'
choices.2.isAnswer -&gt; 'false'
choices.3.text -&gt; 'PHP'
choices.3.isAnswer -&gt; 'false'
choices.4.text -&gt; 'Smalltalk'
choices.4.isAnswer -&gt; 'true'
</pre>
<p>By supporting composition, class Choice can be a normal ActiveItem subclass with its own attribute description. However, as you can see in the example, Choice objects do not need an id (actually the collection index is the id).</p>
<p>Because of <a href="http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/index.html?SDBLimits.html">limitations</a> to the number of attributes per item (currently 256), this composition solution is not suitable for arbitrary large collections. If you expect this for your model then I suggest you use the normal <strong>hasMany:</strong> method that maps associations using &#8220;foreign-key&#8221; attributes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=212&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/04/20/composition-relations-in-cloudfork-activeitem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ae4660044c0bb7b590e3de213011a458?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emicklei</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems with Daylight saving time in VA Smalltalk</title>
		<link>http://blog.doit.st/2009/03/29/problems-with-daylight-saving-time-in-va-smalltalk/</link>
		<comments>http://blog.doit.st/2009/03/29/problems-with-daylight-saving-time-in-va-smalltalk/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 21:17:54 +0000</pubDate>
		<dc:creator>Jan van de Sandt</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[sqs]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[simpledb]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[vasmalltalk]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=204</guid>
		<description><![CDATA[All the requests that Cloudfork-AWS sends to the Amazon web services contain the current date and time in Coordinated Universal Time (UTC). If this timestamp differs more than a few seconds from the current time you get an error. For example the S3 error: RequestTimeTooSkewed &#8211; The difference between the request time and the current [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=204&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>All the requests that Cloudfork-AWS sends to the Amazon web services contain the current date and time in Coordinated Universal Time (UTC). If this timestamp differs more than a few seconds from the current time you get an error. For example the S3 error: RequestTimeTooSkewed &#8211; The difference between the request time and the current time is too large. The reason for this time check is security, it prevents &#8220;record en playback&#8221; attacks.</p>
<p>So systems that make use of AWS must have the correct time and also the timezone must be correct. Otherwise the conversion to UTC will give the wrong result. A few days ago this all worked perfectly in VA Smalltalk, but tonight all AWS calls fail <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Last night we in The Netherlands switched to Daylight saving time (DST). VA Smalltalk doesn&#8217;t seem to handle this very well. A call to &#8220;DateAndTime now&#8221; still returns an offset from UTC as one hour instead of two. It seems that this is a <a href="http://www.instantiations.com/forum/viewtopic.php?f=12&amp;t=1951&amp;start=0&amp;st=0&amp;sk=t&amp;sd=a&amp;hilit=DST">known problem</a>.</p>
<p>Until this problem is fixed we have to use a less than elegant solution to get things working again. We have added a &#8220;DSTMode&#8221; flag, when this flag is true we subtract an extra hour when converting to UTC. You can enable this mode by executing:</p>
<p><code><br />
CFPlatformServiceVASTUtils enableDSTMode: true<br />
</code></p>
<p>Support for the DSTMode was built into <a href="http://vastgoodies.com/main/maps/Cloudfork">Cloudfork version jvds.79</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=204&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/03/29/problems-with-daylight-saving-time-in-va-smalltalk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/39f97e9c1b95363b4f3db5e120bf2c45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jvdsandt</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting started with SimpleDB using Cloudfork</title>
		<link>http://blog.doit.st/2009/03/29/getting-started-with-simpledb-using-cloudfork/</link>
		<comments>http://blog.doit.st/2009/03/29/getting-started-with-simpledb-using-cloudfork/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 11:46:17 +0000</pubDate>
		<dc:creator>Ernest Micklei</dc:creator>
				<category><![CDATA[Cloudfork]]></category>
		<category><![CDATA[activeitem]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[dictionary]]></category>
		<category><![CDATA[relational]]></category>
		<category><![CDATA[simpledb]]></category>

		<guid isPermaLink="false">http://blog.doit.st/?p=28</guid>
		<description><![CDATA[The Cloudfork-AWS project has classes to use the Amazon Web Services Simple Database (SimpleDB) directly from Smalltalk. Using these classes, you can create domains, put items, and query items even using regular Smalltalk blocks.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=28&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The Cloudfork-AWS project has classes to use the Amazon Web Services Simple Database (SimpleDB) directly from Smalltalk. Using these classes, you can create domains, put items, and query items even using regular Smalltalk blocks. Cloudfork contains the CFSimpleDB class that makes the generic calls available as Smalltalk methods. Calls that are related to a domain are implemented in the CFSimpleDBDomain class.</p>
<p><strong>SimpleDB</strong><br />
In short, SimpleDB items are stored in a domain which has a name. Each item has a name and a collection of attributes. Each attribute has a name and one or more values. Values can be String only ; the application must take care of conversion. SimpleDB provides a database in the cloud that supports large volumes of data that can be accessed anywhere on the Internet. Amazon Web Services (AWS) takes care of high availability, consistency, indexing and performance.</p>
<p>Before throwing away your current persistency, it is important to realize that SimpleDB is not a relational database. It does not provide relational consistency (constraints), does not have a schema and &#8220;records&#8221; contain String values only. Queries on items require expressions that have limited operators; no joins, no subselects (see <a href="http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/DeveloperGuide/">documentation</a>).</p>
<p><strong>Use case</strong><br />
Besides being a simple object database, the service can be used to store reference data (e.g. zipcode tables, gps locations, currencies) or logging information (audits). Another example is storing social user profiles which typically have a variable set of properties. SimpleDB can also be used for storing metadata and references to S3 objects such as images,video and documents. Because a S3 object can contain any data, it can be used to store large attribute values that do not fit into a SimpleDB item.</p>
<p><strong>Smalltalk</strong><br />
After subscribing to the SimpleDB services with your AWS account, you must create the credentials object:</p>
<pre class="brush: ruby;">
awsCredentials := CFAWSCredentials
  newWith: '&lt;your access key&gt;'
  andSecret: '&lt;your secret access key&gt;'.
</pre>
<p><strong>Create a SimpleDB domain</strong><br />
To store items we need a domain, let us create one. Every api call returns a CFAWSResponse which must be checked for errors before using its result.</p>
<pre class="brush: ruby;">
sdb := CFSimpleDB newWith: awsCredentials.
response := sdb createDomain: 'zipcodes'.
response isError
  ifFalse:[domain := response result]
</pre>
<p><strong>Add items</strong><br />
The variable &#8220;domain&#8221; will be an instance of CFSimpleDBDomain that has various methods to access its items. For convenience, class CFSimpleDBItem can be used to encapsulate the name of the item and its attributes (name,value pairs).</p>
<pre class="brush: ruby;">
item := CFSimpleDBItem newNamed: '3768GX'.
item valueAt: 'city' put: 'Soest'.
item valueAt: 'country' put: 'Netherlands'.
domain putItem: item.
</pre>
<p><strong>Query items using expressions</strong><br />
AWS SimpleDB offers two sets of api calls that support criteria-based retrieval. You can use the query syntax:</p>
<pre class="brush: ruby;">
domain query: '[''country'' = ''Netherlands'']'.
</pre>
<p>Or the select expressions:</p>
<pre class="brush: ruby;">
sdb select: 'select city from zipcodes'.
</pre>
<p>More details on quering using &#8220;select&#8221; and &#8220;query&#8221; can be found at the AWS SimpleDB<a href="http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/DeveloperGuide/"> documentation.</a></p>
<p><strong>Query items using Block</strong><br />
Cloudfork has classes that support the use of normal Smalltalk blocks to define the select condition. See the documentation for all possible operators and functions and class CFSSWOperand for the Smalltalk counterpart.</p>
<pre class="brush: ruby;">
domain selectAllWhere: [:each | each country = 'Netherlands'].
</pre>
<p><strong>Delete a SimpleDB domain</strong><br />
Deleting a domain will also delete all its items. No warning here.</p>
<pre class="brush: ruby;">
sdb deleteDomain: 'zipcodes'.
</pre>
<p>This post showed you the basic usage of the Cloudfork SimpleDB services. Browse the classes in this package to see how other SimpleDB API services are mapped to Smalltalk messages. Also have a look at the CFSimpleDBEmulator which can used for Unit testing classes that use Cloudfork-AWS SimpleDB.</p>
<p>If you are planning to use SimpleDB as an object database, then have a look at <a href="http://blog.doit.st/2009/01/16/getting-started-with-cloudfork-activeitem/">Cloudfork-ActiveItem</a>. It is a framework that can help in mapping your objects to SimpleDB items and takes care of String conversions, data sharding and can handle associations similar to Rails ActiveRecord.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/doitinthecloud.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/doitinthecloud.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/doitinthecloud.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.doit.st&blog=5990700&post=28&subd=doitinthecloud&ref=&feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.doit.st/2009/03/29/getting-started-with-simpledb-using-cloudfork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ae4660044c0bb7b590e3de213011a458?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">emicklei</media:title>
		</media:content>
	</item>
	</channel>
</rss>