<?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>Nico de Wet</title>
	<atom:link href="http://nicodewet.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nicodewet.com</link>
	<description>Nico&#039;s thoughts on business, software and more</description>
	<lastBuildDate>Sat, 18 May 2013 21:25:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nicodewet.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6c97c13a7b730da2fa2cd532a109d63c?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Nico de Wet</title>
		<link>http://nicodewet.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nicodewet.com/osd.xml" title="Nico de Wet" />
	<atom:link rel='hub' href='http://nicodewet.com/?pushpress=hub'/>
		<item>
		<title>VoucherTool Unique Code Generator &amp; Voucher Management Platform: Release</title>
		<link>http://nicodewet.com/2013/04/01/vouchertool-unique-code-generator-voucher-management-platform-release/</link>
		<comments>http://nicodewet.com/2013/04/01/vouchertool-unique-code-generator-voucher-management-platform-release/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 09:02:45 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=972</guid>
		<description><![CDATA[After two years of development a new version of VoucherTool was released today. With the performance improvements realised with this release the vision of VoucherTool serving as a core telecommunications grade component generating batches of tens to hundreds of millions of vouchers becomes a reality. Key enhancements include: Significant performance improvements A free unique code [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=972&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After two years of development a new version of <a href="https://www.vouchertool.com" target="_blank">VoucherTool</a> was released today. With the performance improvements realised with this release the vision of VoucherTool serving as a core telecommunications grade component generating batches of tens to hundreds of millions of vouchers becomes a reality.</p>
<p>Key enhancements include:</p>
<ul>
<li>Significant performance improvements</li>
<li>A free unique code generator for generating and downloading up to 1000 unique codes</li>
</ul>
<p>The latter was included since using the SOAP API, <a href="http://nicodewet.com/2012/11/01/vouchertool-voucher-management-web-service-release/" target="_blank">released last November</a>, is an investment. I wanted to see the tool being used and tested rapidly and the unique code generator is one way to do that.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/972/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=972&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/04/01/vouchertool-unique-code-generator-voucher-management-platform-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>The Development Manager Role &#8211; An Essential Counter Weight</title>
		<link>http://nicodewet.com/2013/03/18/the-development-manager-role-an-essential-counter-weight/</link>
		<comments>http://nicodewet.com/2013/03/18/the-development-manager-role-an-essential-counter-weight/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 06:23:28 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=967</guid>
		<description><![CDATA[Project oriented development organizations have their plus points, but one should never forget this basic and fundamental point. And that is that there is an inherit conflict of interest in between the Development Manager and the Project Manager. In my opinion the role serves as an essential counter weight, and by that I mean a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=967&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nicodewet.files.wordpress.com/2013/03/nicodewet-com_conflict.jpg"><img class="alignleft size-full wp-image-968" style="border:5px solid white;" alt="Gemsbok fight" src="http://nicodewet.files.wordpress.com/2013/03/nicodewet-com_conflict.jpg?w=600"   /></a>Project oriented development organizations have their plus points, but one should never forget this basic and fundamental point. And that is that there is</p>
<blockquote><p><a href="http://www.infoq.com/articles/development-manager-role" target="_blank">an inherit conflict of interest in between the Development Manager and the Project Manager</a>.</p></blockquote>
<p>In my opinion the role serves as an essential counter weight, and by that I mean a counter weight to short term profit oriented actions in software development projects that end up killing long term profitability.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/967/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/967/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=967&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/03/18/the-development-manager-role-an-essential-counter-weight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>

		<media:content url="http://nicodewet.files.wordpress.com/2013/03/nicodewet-com_conflict.jpg" medium="image">
			<media:title type="html">Gemsbok fight</media:title>
		</media:content>
	</item>
		<item>
		<title>IP address specific port 80 to port of your choice NAT iptables rules</title>
		<link>http://nicodewet.com/2013/03/03/ip-address-specific-port-80-to-port-of-your-choice-nat-iptables-rules/</link>
		<comments>http://nicodewet.com/2013/03/03/ip-address-specific-port-80-to-port-of-your-choice-nat-iptables-rules/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 18:57:34 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[sys admin]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=957</guid>
		<description><![CDATA[Corporate firewalls can be a pain, you could well drown in a sea of red tape and meetings just to route traffic across any port but port 80 and 443. In this post we avoid swimming upstream, and go with the port 80 and 443 flow in a system level quality assurance testing scenario with [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=957&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Corporate firewalls can be a pain, you could well drown in a sea of red tape and meetings just to route traffic across any port but port 80 and 443. In this post we avoid swimming upstream, and go with the port 80 and 443 flow in a system level quality assurance testing scenario with a simple iptables  rules.</p>
<p>Before we get onto the iptables rules, here is the exact scenario to give this post context.</p>
<ol>
<li>We have a system under test, which has a public IP address, and a remote test server which also happens to have a public IP address.</li>
<li>The system under test accepts REST calls on port 443, that is we are dealing with HTTPS traffic.</li>
<li>The system under test, in response to REST calls, will fire asynchronous REST callbacks to our remote test server, so we are dealing with bi-directional communication.</li>
<li>A corporate firewall dictates that the asynchronous REST callbacks can only happen on port 80 or on port 443.</li>
<li>Our remote test server already has a service running on port 80, so our HTTP listener, that waits for incoming REST callbacks, will have to run on another available port, say 8009.</li>
</ol>
<p>So, here is the configuration that we will have to do on our test server.</p>
<pre class="brush: bash; title: ; notranslate">
# For a manual check of the rule below, run $sudo nc -l -v 8009 then ssh into the remote host (303.66.500.90) and execute $nc -v -z 55.333.536.4
iptables -t nat -I PREROUTING 1 -p tcp -s 303.66.500.90 --dport 80 -j REDIRECT --to-port 8009
</pre>
<p>Please note that the IP addresses where randomly generated. The rule above means that on our test server (with mentioned IP address 55.333.536.4), we&#8217;ll route traffic from our system under test (with IP address 303.66.500.90) on port 80 to port 8009. Presumably our test HTTP listener will be listening on port 8009.</p>
<p>Thats it, its working for me, hope it does for you too.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/957/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/957/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=957&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/03/03/ip-address-specific-port-80-to-port-of-your-choice-nat-iptables-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 12.04 Jenkins Configuration &#8211; Quick &amp; Private</title>
		<link>http://nicodewet.com/2013/03/03/ubuntu-12-04-jenkins-configuration-quick-private/</link>
		<comments>http://nicodewet.com/2013/03/03/ubuntu-12-04-jenkins-configuration-quick-private/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 18:15:39 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[jenkins]]></category>
		<category><![CDATA[sys admin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=937</guid>
		<description><![CDATA[This post is concerned with getting Jenkins going on your public server as quickly as possible whilst keeping things private. $ sudo apt-get install jenkins If we have a service running on port 8080 Jenkins won&#8217;t start. $ sudo tail /var/log/jenkins/jenkins.log In such a case, lets change the port, and we&#8217;ll do so in the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=937&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This post is concerned with getting Jenkins going on your public server as quickly as possible whilst keeping things private.</p>
<p><strong>$ sudo apt-get install jenkins</strong></p>
<p>If we have a service running on port 8080 Jenkins won&#8217;t start.</p>
<p><strong>$ sudo tail /var/log/jenkins/jenkins.log</strong></p>
<p>In such a case, lets change the port, and we&#8217;ll do so in the config file.</p>
<p><strong>$ sudo nano /etc/default/jenkins</strong></p>
<p>If this is a public server, lets add in authentication, and we&#8217;ll take the quick route by adding the following to the end of the JENKINS_ARGS (naturally change the password to suit):</p>
<p>&#8211;argumentsRealm.passwd.admin=topsecret &#8211;argumentsRealm.roles.admin=admin</p>
<p>The configuration up to this point is not enough when it comes to a public web server, since the world at large can still see our main Jenkins page, but its a start, since at the very least we have administrative control. We would still want to <a href="https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins" target="_blank">run our service over https</a> and add http basic authentication, with the latter <a href="https://wiki.jenkins-ci.org/display/JENKINS/Apache+frontend+for+security" target="_blank">entailing fronting Jenkins with Apache and configuring an AJP connector between Jenkins and Apache</a>.</p>
<p>If you are in  rush though, or just don&#8217;t want to install and administer Apache, you can use matrix-based security to disable read privileges for anonymous users, it is easy to lock out your sole admin user if you do this though, and if you do (as I did), you&#8217;ll have to shutdown Jenkins, edit /var/lib/jenkins/config.xml and in false in &lt;useSecurity&gt;true&lt;/useSecurity&gt; and start it up again. All you&#8217;ll have to do is to follow the instructions on <a href="https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup" target="_blank">this page</a> for matrix-based security exactly (the sign up step seems odd, but it seems necessary). After you have signed up, disable read access for the Anonymous user and you are good to go.</p>
<p><strong>Upgrading</strong></p>
<p>/usr/share/jenkins$ sudo service jenkins stop</p>
<p>/usr/share/jenkins$ sudo mv jenkins.war jenkins_old.war</p>
<p>/usr/share/jenkins$ sudo wget <a href="http://updates.jenkins-ci.org/download/war/1.480.3/jenkins.war" rel="nofollow">http://updates.jenkins-ci.org/download/war/1.480.3/jenkins.war</a></p>
<p>/usr/share/jenkins$ service jenkins start</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/937/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/937/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=937&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/03/03/ubuntu-12-04-jenkins-configuration-quick-private/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>JPA Lazy Collection Loading</title>
		<link>http://nicodewet.com/2013/02/11/jpa-lazy-collection-loading/</link>
		<comments>http://nicodewet.com/2013/02/11/jpa-lazy-collection-loading/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 09:20:33 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JPA]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=932</guid>
		<description><![CDATA[If all you are looking for is how to load a lazy collection with JPA, you&#8217;ll be swamped with endless posts and articles going on about the pros and cons of using lazy or eager loading. Its all noise if your question is simply how do I load my lazy collection using the JPA API? [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=932&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If all you are looking for is how to load a lazy collection with JPA, you&#8217;ll be swamped with endless posts and articles going on about the pros and cons of using lazy or eager loading. Its all noise if your question is simply <em>how do I load my lazy collection using the JPA API?</em></p>
<p>The quick and dirty answer is just do this: <strong>singleFoo.getBars().size();</strong></p>
<p>There it is. End of story. It is worth noting that I&#8217;m an advocate of using a Service Facade and DTOs, in other words clean APIs and I use Spring&#8217;s transactional annotations on the service layer. Also, you will come across posts mentioning Hibernate and initialization methods, this doesn&#8217;t help since we are only interested in pure JPA here.</p>
<p>Sure there is alot more to it and there are pitfalls to consider, that is old news, any layer of abstraction comes at it price and in some way dumbs you down (mmm, getting philisophical, its so easy to do).</p>
<p>This is one of the posts I was referring to, and it was a distraction: <a href="http://techblog.bozho.net/?p=645" target="_blank">Avoid Lazy JPA Collections</a>. A better read would be this one: <a href="http://java.dzone.com/articles/jpa-lazy-loading" target="_blank">JPA Implementation Patterns: Lazy Loading</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/932/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/932/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=932&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/02/11/jpa-lazy-collection-loading/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring Core Training Review</title>
		<link>http://nicodewet.com/2013/01/25/spring-core-training-review/</link>
		<comments>http://nicodewet.com/2013/01/25/spring-core-training-review/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 18:40:17 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=927</guid>
		<description><![CDATA[I&#8217;ve just finished a four day Spring Core training course in Wellington, New Zealand. These are my thoughts. I&#8217;d already been a Spring user for roughly 2 years, predominantly using 2.5.6 is a commercial setting, and had always wanted to do the Spring Core course, especially since there are areas of Spring 3 that I [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=927&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just finished a four day Spring Core training course in Wellington, New Zealand. These are my thoughts.</p>
<p>I&#8217;d already been a Spring user for roughly 2 years, predominantly using 2.5.6 is a commercial setting, and had always wanted to do the Spring Core course, especially since there are areas of Spring 3 that I don&#8217;t use and don&#8217;t always get the time to work with when it comes to my day to day tasks.</p>
<p>What I liked about the course:</p>
<ul>
<li>The lecturer, who made the notes come to life. I had no idea who would be lecturing, as it turned out Spring sent a highly experienced industry veteran with a PhD in computer science, Dr. Paul Chapman.</li>
<li>The student pack with notes, lab notes and preprepared SpringSource Tool Suite so we could get stuck into the labs without struggling with environment issues. Awesome.</li>
<li>The labs, 30 to 45 minutes and they never cut corners, its all about best practices and Spring sticks to its guns all the way.</li>
<li>The venue, with a view over the whole of Wellington.We had regular breaks with coffee and great cookies.</li>
<li>The lunch vouchers and chatting to the lecturer and fellow students over lunch.</li>
<li>The pace, we covered a broad spectrum of topics and roughly 12 labs. At an academic university these 4 days would have been spread over a semester.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/927/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/927/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=927&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2013/01/25/spring-core-training-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Your Feet Wet: The MS Reference License and the Sonatype OSS Maven Repository?</title>
		<link>http://nicodewet.com/2012/12/30/getting-your-feet-wet-the-ms-reference-license-and-the-sonatype-oss-maven-repository/</link>
		<comments>http://nicodewet.com/2012/12/30/getting-your-feet-wet-the-ms-reference-license-and-the-sonatype-oss-maven-repository/#comments</comments>
		<pubDate>Sun, 30 Dec 2012 03:07:49 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=918</guid>
		<description><![CDATA[This post is concerned with my licensing decisions regarding publishing a wsdl within a distributable jar with the view of using the Sonatype OSS Maven Repository so that I can create a demo Maven project that pulls in the jar and reference wsdl implemented by my web service (www.vouchertool.com) I have a simple requirement, and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=918&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This post is concerned with my licensing decisions regarding publishing a wsdl within a distributable jar with the view of using the <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">Sonatype OSS Maven Repository</a> so that I can create a demo Maven project that pulls in the jar and reference wsdl implemented by my web service (<a href="https://www.vouchertool.com">www.vouchertool.com</a>)</p>
<p>I have a simple requirement, and that is to publish an artifact containing a SOAP wsdl and an accompanying set of Java classes, predominantly generated from the wsdl.</p>
<p>For now, I don&#8217;t want to, nor have the time to, spend hours researching the most appropriate license, all I want to do is to retain all my rights, in particular commercial rights, when it comes to my wsdl, as its my intellectual property. So, having already spent a few hours on this, including reading informative posts such as <a href="http://www.codinghorror.com/blog/2007/04/pick-a-license-any-license.html">&#8220;Pick a License, Any License&#8221;</a>, I&#8217;ve come the the conclusion that the best course of action is to pick the MS Reference License as a base and naturally I will be the Licensor, not Microsoft, and naturally there will be no platform restriction.</p>
<p>So, this is my way of getting my feet wet, perhaps I&#8217;m going down the wrong road, perhaps not.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/918/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/918/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=918&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2012/12/30/getting-your-feet-wet-the-ms-reference-license-and-the-sonatype-oss-maven-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>WS-Security Basic Policy Definition And Client Testing In Java With JAX-WS</title>
		<link>http://nicodewet.com/2012/11/17/ws-security-basic-policy-definition-and-client-testing-in-java-with-jax-ws/</link>
		<comments>http://nicodewet.com/2012/11/17/ws-security-basic-policy-definition-and-client-testing-in-java-with-jax-ws/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 20:44:33 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jax-ws]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[ws-security]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=895</guid>
		<description><![CDATA[If you&#8217;ve defined a wsdl and need to introduce the most basic security policy, generate the client side code and then run some integration tests then this post may help you. The focus here is on getting it all working, not the most efficient solution, and neither the most secure. We choose a UsernameToken with [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=895&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;ve defined a wsdl and need to introduce the most basic security policy, generate the client side code and then run some integration tests then this post may help you.</p>
<p>The focus here is on getting it all working, not the most efficient solution, and neither the most secure. We choose a <strong>UsernameToken with plain text password</strong> and work that into the wsdl, then generate code with the Maven <strong>cxf-codegen-plugin</strong>, then find a way to <strong>add the missing security headers</strong> and finally write an integration test.</p>
<p>In terms of context, the steps below where followed in a project where a web service was implemented, and already thoroughly tested using the help of jetty and the maven-soapui-plugin with the latter executing tests during the integration-test phase.</p>
<p><strong>Step 1: Modify The WSDL</strong></p>
<p>The pretinent parts of the <a href="http://vouchertool.com/vouchserv/vouchserv.wsdl" target="_blank">this wsdl</a> are shown below. Note the wsp:PolicyReference below the wsdl:service element.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;wsdl:definitions
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
xmlns:sch=&quot;http://vouchertool.com/vouchserv/schemas&quot;
xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
xmlns:tns=&quot;http://vouchertool.com/vouchserv/definitions&quot;
targetNamespace=&quot;http://vouchertool.com/vouchserv/definitions&quot;
xmlns:wsp=&quot;http://www.w3.org/ns/ws-policy&quot;
xmlns:wsu=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;
xmlns:sp=&quot;http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702&quot;&gt;
&lt;wsdl:types xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;
...
&lt;wsdl:service name=&quot;VoucherServiceService&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;
  &lt;wsp:PolicyReference xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2004/09/policy&quot; URI=&quot;#VouchUsernameToken&quot;/&gt;
  &lt;wsdl:port binding=&quot;tns:VoucherServiceSoap11&quot; name=&quot;VoucherServiceSoap11&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;
    &lt;soap:address location=&quot;http://vouchertool.com:80/vouchserv/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;/&gt;
  &lt;/wsdl:port&gt;
&lt;/wsdl:service&gt;

&lt;wsp:Policy wsu:Id=&quot;VouchUsernameToken&quot;&gt;
  &lt;sp:SupportingTokens&gt;
    &lt;wsp:Policy&gt;
      &lt;sp:UsernameToken
sp:IncludeToken=&quot;http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient&quot;&gt;
        &lt;wsp:Policy/&gt;
      &lt;/sp:UsernameToken&gt;
    &lt;/wsp:Policy&gt;
  &lt;/sp:SupportingTokens&gt;
&lt;/wsp:Policy&gt;
 </pre>
<p><strong>Step2: Code Generation In Our Maven Pom Using cxf-codegen-plugin</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;plugin&gt;
  &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
  &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
  &lt;version&gt;${cxf.version}&lt;/version&gt;
  &lt;executions&gt;
    &lt;execution&gt;
      &lt;id&gt;generate-sources&lt;/id&gt;
      &lt;phase&gt;generate-sources&lt;/phase&gt;
      &lt;configuration&gt;
        &lt;sourceRoot&gt;${basedir}/src/main/java/&lt;/sourceRoot&gt;
        &lt;wsdlOptions&gt;
          &lt;wsdlOption&gt;
            &lt;wsdl&gt;${basedir}/src/main/webapp/WEB-INF/wsdl/vouchserv.wsdl&lt;/wsdl&gt;
            &lt;extraargs&gt;
              &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
            &lt;/extraargs&gt;
          &lt;/wsdlOption&gt;
        &lt;/wsdlOptions&gt;
      &lt;/configuration&gt;
      &lt;goals&gt;
        &lt;goal&gt;wsdl2java&lt;/goal&gt;
      &lt;/goals&gt;
    &lt;/execution&gt;
  &lt;/executions&gt;
&lt;/plugin&gt;
</pre>
<p><strong>Step 3: Add A HeaderHandler and HeaderHandlerResolver</strong></p>
<p><a href="http://www.javadb.com/using-a-message-handler-to-alter-the-soap-header-in-a-web-service-client" target="_blank">This post</a> shows how to add the security headers. It works, try it. You&#8217;ll need some solution since the code generated by cxf will not provide any means of adding the headers, which is naturally suboptimal.</p>
<p><strong>Step 4: Test It All Using An Integration Test</strong></p>
<pre class="brush: java; title: ; notranslate">
public class VoucherServiceIT {

@Test
public void test() {
  URL url = null;
  try {
    url = new URL(&quot;http://localhost:8080/vouchserv/vouchserv.wsdl&quot;);
  } catch (MalformedURLException e) {
   throw new RuntimeException(e);
  }

  VoucherServiceService voucherServiceService = new VoucherServiceService(url);
  HeaderHandlerResolver handlerResolver = new HeaderHandlerResolver();
  voucherServiceService.setHandlerResolver(handlerResolver);
  VoucherService voucherService = voucherServiceService.getVoucherServiceSoap11();
  RegisterRequest registerRequest = new RegisterRequest();
  RegisterResponse registerResponse = voucherService.register(registerRequest);
}

}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/895/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/895/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=895&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2012/11/17/ws-security-basic-policy-definition-and-client-testing-in-java-with-jax-ws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>VoucherTool Voucher Management Web Service: Release</title>
		<link>http://nicodewet.com/2012/11/01/vouchertool-voucher-management-web-service-release/</link>
		<comments>http://nicodewet.com/2012/11/01/vouchertool-voucher-management-web-service-release/#comments</comments>
		<pubDate>Thu, 01 Nov 2012 10:05:15 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=890</guid>
		<description><![CDATA[An updated version of the MAYLOOM™ SOAP voucher management web sevice was released today. The WSDL and associated  XSD are available for public review. The voucher service was created as a reusable generic component intended to ultimately avoid having to reinvent the voucher management wheel which has no doubt been done countless times. Tutorials, extensive [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=890&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>An updated version of the <a href="http://mayloom.com/2012/08/28/vouchertool/" target="_blank">MAYLOOM™ SOAP voucher management web sevice</a> was released today. The <a href="http://vouchertool.com/vouchserv/vouchserv.wsdl" target="_blank">WSDL and associated  XSD are available for public review</a>.</p>
<p>The voucher service was created as a reusable generic component intended to ultimately avoid having to reinvent the voucher management wheel which has no doubt been done countless times. Tutorials, extensive documentation and sample applications will be published as soon as time allows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/890/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=890&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2012/11/01/vouchertool-voucher-management-web-service-release/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic string concatenation by example, 3900 times more expensive than StringBuilder</title>
		<link>http://nicodewet.com/2012/10/08/dynamic-string-concatenation-by-example-3900-times-more-expensive-than-stringbuilder/</link>
		<comments>http://nicodewet.com/2012/10/08/dynamic-string-concatenation-by-example-3900-times-more-expensive-than-stringbuilder/#comments</comments>
		<pubDate>Mon, 08 Oct 2012 09:21:57 +0000</pubDate>
		<dc:creator>nicodewet</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://nicodewet.com/?p=866</guid>
		<description><![CDATA[The significant cost associated with using the String concatenation operator, and need to use a StringBuilder instead of a String to store the interim object under construction, is well known. In this post, we start by firstly presenting eye opening results from some performance tests to quantify why one needs to consider the cost of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=866&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nicodewet.files.wordpress.com/2012/10/nicodewet-com_pearl.jpg"><img class="alignleft size-full wp-image-867" style="border:5px solid white;" title="Auster mit Perle, Freisteller, close-up" src="http://nicodewet.files.wordpress.com/2012/10/nicodewet-com_pearl.jpg?w=600" alt=""   /></a>The significant cost associated with using the String concatenation operator, and need to use a StringBuilder instead of a String to store the interim object under construction, is well known. In this post, we start by firstly presenting eye opening results from some performance tests to quantify why one needs to consider the cost of String concatenation, we then take a look under the hood to see why dynamic String concatenation is so inefficient.</p>
<h3>Performance Tests: Does Concatenating <em>n</em> Strings Really Take Time Quadratic in <em>n</em>?</h3>
<p>Joshua Bloch, in Effective Java, advises that using the concatenation operator repeatedly to concatenate <em>n</em> strings requires time quadratic in <em>n</em> due to strings being immutable and the need to copy the contents of both strings when performing a concatenation operation.</p>
<p>In terms of <a href="http://en.wikipedia.org/wiki/Big_O_notation" target="_blank">Big O notation</a>, the above means O(n²) or <em> O-n-squared, </em>which is disastrous time wise. To see just how disastrous, here are the results of 4 runs of a simple test, the 5th run was stopped since I was not willing to wait approximately 40 seconds squared.</p>
<table border="1">
<tbody>
<tr>
<td>
<p style="text-align:center;">Number concatenations</p>
</td>
<td>+/ms</td>
<td>StringBuider.append/ms</td>
</tr>
<tr>
<td>100</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1000</td>
<td>22</td>
<td>0</td>
</tr>
<tr>
<td>10 000</td>
<td>306</td>
<td>1</td>
</tr>
<tr>
<td>100 000</td>
<td>39 259</td>
<td>10</td>
</tr>
</tbody>
</table>
<p>The results show an exponential increase in time when looking at the concatenation time column and since big O time estimates are not exact, one can say yes, concatenating <em>n</em> strings really does take time quadratic in <em>n</em>.</p>
<p>If you&#8217;d like to run the tests on your machine, please find the simple program used below.</p>
<pre class="brush: java; title: ; notranslate">
public class StringConcatenationPerformance {

	public static void main(String[] args) {

        final String base = getBaseString();
        int CONCATENATIONS = 1000;

        long startTime = System.currentTimeMillis();

        String result = base;

        for(int i = 0; i &lt; CONCATENATIONS ; i++) {
            result = result + &quot;b&quot;;
        }

        long estimatedTime = System.currentTimeMillis() - startTime;

        System.out.println(result.length());
        System.out.println(estimatedTime);

        startTime = System.currentTimeMillis();
        StringBuilder builder = new StringBuilder(base);
        for(int i = 0; i &lt; CONCATENATIONS ; i++) {
            builder.append(&quot;b&quot;);
        }
        estimatedTime = System.currentTimeMillis() - startTime;
        System.out.println(builder.toString().length());
        System.out.println(estimatedTime);

    }

    private static String getBaseString() {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i &lt; 1000; i++) {
            builder.append(&quot;a&quot;);
        }
        return builder.toString();
    }

}
</pre>
<h3>String Concatenation: Under The Hood</h3>
<p><a href="http://blog.eyallupu.com/2010/09/under-hood-of-java-strings.html" target="_blank">Eyal Lupu</a> has kindly done the hard work of opening the hood, meaning that he used the <a href="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javap.html" target="_blank">javap utility</a> (java class file disassembler) to look at the generated byte code of a concatenation loop.</p>
<p>His results show that the following:</p>
<pre class="brush: java; title: ; notranslate">
String result = &quot;&quot;;
for (int t=0; t&lt;10000; ++t ) {
 result = result + getSomeString();
}
</pre>
<p>Results, in effect, in the following:</p>
<pre class="brush: java; title: ; notranslate">
String result = &quot;&quot;;
for (int t=0; t&lt;10000; ++t ) {
 result = new StringBuilder(String.valueOf(result)).append(getSomeString()).toString();
}
</pre>
<p>The above created 10 000 Strings on the heap, 10 000 StringBuilder objects, then there is the additional cost of, within StringBuilder.append, allocating an array large enough to fit our characters and copying characters from the old smaller array to the larger array.</p>
<h3>References</h3>
<ol>
<li><a href="http://blog.eyallupu.com/2010/09/under-hood-of-java-strings.html" target="_blank">Under the Hood of Java Strings Concatenating Performance</a>, Eyal Lupu</li>
<li><a href="http://stackoverflow.com/a/47628" target="_blank">java String concatenation</a>, Tom Hawtin</li>
<li><a href="http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683" target="_blank">Effective Java, Second Edition</a>, Joshua Bloch, Item 51: Beware the performance of string concatenation</li>
<li><a href="http://javapapers.com/core-java/java-string-concatenation/" target="_blank">Java String Concatenation</a>, Joseph Kulandai</li>
<li><a href="http://stackoverflow.com/a/8011440" target="_blank">Stivlo</a></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nicodewet.wordpress.com/866/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nicodewet.wordpress.com/866/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nicodewet.com&#038;blog=8943366&#038;post=866&#038;subd=nicodewet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nicodewet.com/2012/10/08/dynamic-string-concatenation-by-example-3900-times-more-expensive-than-stringbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/17b88a67f6e771cf9b41fcfffdc917e0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nicodewet</media:title>
		</media:content>

		<media:content url="http://nicodewet.files.wordpress.com/2012/10/nicodewet-com_pearl.jpg" medium="image">
			<media:title type="html">Auster mit Perle, Freisteller, close-up</media:title>
		</media:content>
	</item>
	</channel>
</rss>
