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

<channel>
	<title>Jeshurun&#039;s Blog</title>
	<atom:link href="http://blog.jeshurun.ca/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.jeshurun.ca</link>
	<description>A collection of tiny details</description>
	<lastBuildDate>Fri, 04 May 2012 23:48:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Installing Linux Mint 12 on the Alienware M17x R3</title>
		<link>http://blog.jeshurun.ca/technology/installing-linux-mint-12-on-the-alienware-m17x-r3</link>
		<comments>http://blog.jeshurun.ca/technology/installing-linux-mint-12-on-the-alienware-m17x-r3#comments</comments>
		<pubDate>Sun, 22 Apr 2012 01:58:59 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[alienware]]></category>
		<category><![CDATA[linux mint]]></category>
		<category><![CDATA[m17x]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=362</guid>
		<description><![CDATA[I was tasked with getting Linux Mint 12 going on an M17x today. I did what I usually do, which is plop in the cd, keep my fingers crossed, and just hope that all my hardware gets found out of the box. Unfortunately that wasn&#8217;t the case this time around, and as you probably know, [...]]]></description>
			<content:encoded><![CDATA[<p>I was tasked with getting Linux Mint 12 going on an M17x today. I did what I usually do, which is plop in the cd, keep my fingers crossed, and just hope that all my hardware gets found out of the box. Unfortunately that wasn&#8217;t the case this time around, and as you probably know, when that happens, you are in for a bumpy ride. I did finally manage to get everything working right, and thought I would log it here as usual, knowing I would need it again in the future.</p>
<p><span id="more-362"></span></p>
<p>My system is configured with a <strong>GTX580M</strong> gpu, a reguar HDD on Slot 0, and an SSD on Slot 1. I have Windows 7 on the HDD, and my goal is to keep Windows working on this drive, while installing Mint on the SSD. Assuming your goals align, here is what I had to do:</p>
<p><strong>Configuring the BIOS:</strong></p>
<p>The first thing to do is to configure the bios to boot off the Second hard drive (the SSD) first, as this is the drive on which grub will be installed. To do that, go into the bios, and under the Boot menu, set the boot order as -&gt; CD/DVD/BD, Second Hard Drive and finally Hard Drive. Press F10 to save your configuration and exit.</p>
<p><strong>Getting Mint to Boot:</strong></p>
<p>Restart the computer and plop in the Mint 12 DVD. Now normally you would select the Start Linux Mint option, but Mint will fail to boot because acpi runs into problems with the graphics card. To work around this, you will allow you to edit the configuration options passed into the kernel. Highlight this option and press Tab, then right after where it says splash, leave a space and type acpi=off, so it now looks like this:</p>
<pre class="brush: plain; title: ; notranslate"> quiet splash acpi=off -- </pre>
<p>. Press Enter to boot. You should now be able to boot into the Live Desktop.</p>
<p>The only downside to having acpi off is that your fans will be running at full speed all the time during the install. Don&#8217;t worry, we will be able to fix this later.</p>
<p><strong>Installing Mint:</strong></p>
<p>Once the OS has loaded, connect to a Wi-Fi network if possible so the OS can download updates when installing. Click on the CD Icon on the desktop to begin installation. During installation, after you finish partitioning the hard drives, make sure you select the option to install GRUB on the second hard drive, if your configuration is similar to mine. Failing to do so can cause some problems when booting into Windows (the usual ntldr is missing). Installation typically takes about 5 minutes. When its done, pull out the disk and reboot the system.</p>
<p><strong>Rebooting after installation:</strong></p>
<p>You will run into the same acpi issue when rebooting into the operating system, and you will have to edit the kernel params again. When you hit the GRUB page asking you to pick the operating system to boot, highlight &#8220;Linux Mint 12&#8243; and hit &#8220;e&#8221; on your keyboard to edit the configuration. You will again have to add acpi=off to the end of the line which has the quiet and splash options. When you are done, press F10 to boot.</p>
<p><strong>Fixing the GPU</strong>:</p>
<p>When you connect to the internet, Mint should automatically detect your graphics card, and ask you to install the restricted drivers from Nvidia. Select the option which says &#8220;Post release updates&#8221;. Wait for the driver to download and install. Once this is done, also do a full update of the system using the package manager. Now when you reboot your system, you shouldn&#8217;t have to edit the kernel params any more, and acpi (which also controls the fans) should work fine.</p>
<p><strong>Fixing Sound:</strong></p>
<p>To fix the sound issue, open a terminal and type</p>
<pre class="brush: plain; title: ; notranslate">&lt;code&gt;gksudo gedit /etc/modprobe.d/alsa-base.conf&lt;/code&gt;</pre>
<p>. In the file that opens, append</p>
<pre class="brush: plain; title: ; notranslate">&lt;code&gt;options snd-hda-intel model=alienware&lt;/code&gt;</pre>
<p>at the end, in a separate line. Press Ctrl+s to save the file. Now, after you reboot, sound should work fine.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/installing-linux-mint-12-on-the-alienware-m17x-r3/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manually Installing Alfresco on Ubuntu Server</title>
		<link>http://blog.jeshurun.ca/technology/manually-installing-alfresco-on-ubuntu-server</link>
		<comments>http://blog.jeshurun.ca/technology/manually-installing-alfresco-on-ubuntu-server#comments</comments>
		<pubDate>Fri, 02 Mar 2012 11:53:06 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=337</guid>
		<description><![CDATA[I had to install Alfresco recently on a 32 bit server. Since Alfresco does not provide a 32 bit installer any more, I had to put everything together manually, and thought I would document the process here in case I need to reference it in the future. The steps outlined here assume you have a [...]]]></description>
			<content:encoded><![CDATA[<p>I had to install <strong>Alfresco</strong> recently on a <strong>32 bit</strong> server. Since Alfresco does not provide a 32 bit installer any more, I had to put everything together manually, and thought I would document the process here in case I need to reference it in the future.</p>
<p>The steps outlined here assume you have a fresh install of <strong>Ubuntu 10.04</strong> server, and should pertain to both the 32 and 64 bit versions. &lt;INSTALL_DIR&gt; will be /opt/alfresco.</p>
<p><span id="more-337"></span></p>
<p><strong>Installing Java</strong></p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install openjdk-6-jre
</pre>
<p><strong>Setting up MySQL</strong></p>
<p>1. Install MySQL server. During installation, you will have to choose the password for the root user.</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install mysql-server
mysql -u root -p
</pre>
<p>2. Create a database named alfresco. Also create a user named alfresco and grant the user permissions to the alfresco database. You can replace the value for the password with your own value.</p>
<pre class="brush: plain; title: ; notranslate">
create database alfresco;
select password ('alfresco');
grant all privileges on `alfresco`.* to 'alfresco'@'localhost' identified by password '*F9F457310EF9364D42AABE6D8C24A21712C000B5';
exit
</pre>
<p>3. Download the Java connector for MySQL from <a href="http://dev.mysql.com/downloads/mirror.php?id=404191#mirrors" title="MySQL Connector/J" target="_blank">here</a>. Extract the jar file from the download. It is needed when configuring Alfresco.</p>
<p><strong>Installing Alfresco</strong></p>
<p>1. Create a directory named alfresco under /opt/.</p>
<p>2. Create a user named tomcat and assign &lt;INSTALL_DIR&gt; to this user.</p>
<pre class="brush: plain; title: ; notranslate">
sudo mkdir /opt/alfresco
sudo useradd tomcat -M -U -d /opt/alfresco
sudo chown -R tomcat:tomcat /opt/alfresco
</pre>
<p>3. Download the latest version of Alfresco manual installation package <a title="Alfresco 4.0.d" href="https://process.alfresco.com/ccdl/?file=release/community/build-4003/alfresco-community-4.0.d.zip">here</a> (version 4.0.d at the time of writing, check if a newer version is available) and Tomcat 7 from <a title="Tomcat 7" href="http://tomcat.apache.org/download-70.cgi">here</a> to &lt;INSTALL_DIR&gt; using wget.</p>
<p>4. Install unzip to extract the downloaded files. Unzip the alfresco files to a folder named temp and the tomcat binaries to a folder named tomcat. Move everything under temp/web-server/webapps to tomcat/webapps and move temp/web-server/shared to tomcat/. Also move the MySQL java connector which was downloaded earlier into tomcat&#8217;s lib folder. You may find the files under temp/bin useful for installing additional Alfresco modules. If you don&#8217;t need these, you can safely remove the temp directory.</p>
<pre class="brush: plain; title: ; notranslate">
sudo -s
apt-get install unzip
su tomcat
cd ~
mkdir temp
mv alfresco.zip temp/
cd temp
unzip alfresco.zip
cd ..
tar -xf apache-tomcat-7-0-23.tar
mv apache-tomcat-7-0-23 tomcat
mv temp/web-server/webapps/* tomcat/webapps
mv temp/web-server/shared tomcat/
mv temp/mysql-connector.jar tomcat/lib
rm -r temp
</pre>
<p>5. Create a folder named alf_data under &lt;INSTALL_DIR&gt;. This is the main data directory for Alfresco.</p>
<p>6. Install openoffice, pdf2swf and imagemagick</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install imagemagick swftools openoffice.org-common
</pre>
<p>7. Customize the alfresco-global.properties file found in tomcat/shared/classes. The file below configures Alfresco for the MySQL database, configures open office, imagemagick and swftools, disables ftp and email, and uses the default authentication chain.</p>
<pre class="brush: plain; title: ; notranslate">

###############################
## Common Alfresco Properties #
###############################

#
# Sample custom content and index data location
#
dir.root=/opt/www/alf_data

#
# Sample database connection properties
#
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=3306

#
# External locations
#-------------
ooo.exe=/usr/bin/soffice
ooo.enabled=true
img.root=/usr
swf.exe=/usr/bin/pdf2swf

#
# Property to control whether schema updates are performed automatically.
# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
# there are also auto-generated update scripts that will need to be executed.  After
# upgrading to a new version, this can be disabled.
#
db.schema.update=true

#
# MySQL connection
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco?useUnicode=yes&amp;amp;characterEncoding=UTF-8

#
# Index Recovery Mode
#-------------
index.recovery.mode=FULL

#
# Alfresco Email Service and Email Server
#-------------

# Enable/Disable the inbound email service.  The service could be used by processes other than
# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service.
#-------------
email.inbound.enabled=false

# Email Server properties
#-------------
email.server.enabled=false
#email.server.port=25
#email.server.domain=alfresco.com
#email.inbound.unknownUser=anonymous

#
# The default authentication chain
# To configure external authentication subsystems see:
# http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems
#-------------
authentication.chain=alfrescoNtlm1:alfrescoNtlm

#
# URL Generation Parameters (The ${localname} token is replaced by the local server name)
#-------------
alfresco.context=alfresco
alfresco.host=${localname}
alfresco.port=8080
alfresco.protocol=http
#
share.context=share
share.host=${localname}
share.port=8080
share.protocol=http

imap.server.enabled=false
#imap.server.port=143
#imap.server.host=localhost

# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.
# This allows connections to JMX both remotely and locally.
#
alfresco.rmi.services.host=0.0.0.0

#
# RMI service ports for the individual services.
# These seven services are available remotely.
#
# Assign individual ports for each service for best performance
# or run several services on the same port. You can even run everything on 50500 if needed.
#
# Select 0 to use a random unused port.
#
avm.rmi.service.port=50501
avmsync.rmi.service.port=50502
attribute.rmi.service.port=50503
authentication.rmi.service.port=50504
repo.rmi.service.port=50505
action.rmi.service.port=50506
wcm-deployment-receiver.rmi.service.port=50507
monitor.rmi.service.port=50508

# FTP server
ftp.enabled=false

# CIFS
cifs.enabled=true
cifs.Server.Name=rocksolid
cifs.domain=WORKGROUP
cifs.hostanounce=true

cifs.broadcast=0.0.0.0
cifs.tcpipSMB.port=1445
cifs.ipv6.enabled=false
cifs.netBIOSSMB.namePort=1137
cifs.netBIOSSMB.datagramPort=1138
cifs.netBIOSSMB.sessionPort=1139
</pre>
<p><strong>Configuring Tomcat</strong></p>
<p>1. Edit tomcat/conf/catalina.properties and modify the value for shared.loader.</p>
<pre class="brush: plain; title: ; notranslate">
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
</pre>
<p>2. Create a file named server.sh under /opt/alfresco and make the file executable. This file will be used to start and shutdown the server.</p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/sh
# Start or stop Tomcat server

# Set the following to where Tomcat is installed
ALF_HOME=/opt/alfresco
cd &quot;$ALF_HOME&quot;
APPSERVER=&quot;${ALF_HOME}/tomcat&quot;

# When using Sun's jvm, set JAVA_HOME to /usr/lib/jvm/java-6-sun
export JAVA_HOME=&quot;/usr/lib/jvm/java-6-openjdk&quot;
# Set any default JVM values
# This is the maximum I could go with a 32 bit CPU.
# You can set these numbers to much higher values on a 64 bit machine
export JAVA_OPTS='-server -Xms512m -Xmx1470m -XX:MaxPermSize=1G -XX:NewSize=256m'
export JAVA_OPTS=&quot;${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote&quot;
export JAVA_OPTS=&quot;${JAVA_OPTS} -Djava.rmi.server.hostname=localhost&quot;
export JAVA_OPTS=&quot;${JAVA_OPTS} -Djava.awt.headless=true&quot;

#
if [ &quot;$1&quot; = &quot;start&quot; ]; then
  &quot;${APPSERVER}/bin/startup.sh&quot;
elif [ &quot;$1&quot; = &quot;stop&quot; ]; then
  &quot;${APPSERVER}/bin/shutdown.sh&quot;
fi
</pre>
<pre class="brush: plain; title: ; notranslate">
chmod +x server.sh
</pre>
<p>3. Modify permissions to allow the tomcat user ownership of /opt/alfresco</p>
<pre class="brush: plain; title: ; notranslate">
chown -R tomcat:tomcat /opt/alfresco
</pre>
<p>4. Create an init script to start/stop tomcat when the server reboots. Create a file called alfresco.sh under /etc/init.d. Make this file executable and save it with the following contents.</p>
<pre class="brush: plain; title: ; notranslate">
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Alfresco Community Startup Script
# adapted by JD
#

RETVAL=0

start () {
    sudo -u tomcat soffice -headless -accept=&quot;socket,host=127.0.0.1,port=8100;urp;&quot;
    sudo -u tomcat /opt/www/server.sh start &quot;$2&quot;
    iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
    iptables -I INPUT -p tcp --dport 445 -j ACCEPT
    iptables -I INPUT -p tcp --dport 139 -j ACCEPT
    iptables -I INPUT -p udp --dport 137 -j ACCEPT
    iptables -I INPUT -p udp --dport 138 -j ACCEPT
    iptables -I INPUT -p tcp --dport 1445 -j ACCEPT
    iptables -I INPUT -p tcp --dport 1139 -j ACCEPT
    iptables -I INPUT -p udp --dport 1137 -j ACCEPT
    iptables -I INPUT -p udp --dport 1138 -j ACCEPT
    iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
    iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445
    iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139
    iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137
    iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138
    iptables-save
    RETVAL=$?
}

stop () {
    sudo -u tomcat /opt/alfresco/server.sh stop &amp;quot;$2&amp;quot;
    RETVAL=$?
}
case &amp;quot;$1&amp;quot; in
    start)
        start &amp;quot;$@&amp;quot;
        ;;
    stop)
        stop &amp;quot;$@&amp;quot;
        ;;
    restart)
        stop &amp;quot;$@&amp;quot;
        start &amp;quot;$@&amp;quot;
        ;;
    *)
        sudo -u tomcat /opt/alfresco/server.sh &amp;quot;$@&amp;quot;
        RETVAL=$?
esac
exit $RETVAL
</pre>
<p>5. Finally su as tomcat and start the server</p>
<pre class="brush: plain; title: ; notranslate">
su tomcat
cd ~
./server.sh start
</pre>
<p>6. You may also want to setup so iptable rules to allow access on port 80. </p>
<pre class="brush: plain; title: ; notranslate">
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables-save
</pre>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/manually-installing-alfresco-on-ubuntu-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Java compliant WSDL file for Zimbra Admin&#8217;s SOAP API</title>
		<link>http://blog.jeshurun.ca/technology/a-java-compliant-wsdl-for-zimbras-admin-soap-api</link>
		<comments>http://blog.jeshurun.ca/technology/a-java-compliant-wsdl-for-zimbras-admin-soap-api#comments</comments>
		<pubDate>Sun, 18 Dec 2011 06:24:55 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[wsdl]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=306</guid>
		<description><![CDATA[Not too long ago I had to interface with Zimbra&#8216;s admin API for one of my projects, and quickly realized that it is er.. a little weird. You see, Zimbra has a SOAP (and also a limited REST) API, but does not does not publish a WSDL for them. Neither is an xsd or DTD [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long ago I had to interface with <strong><em>Zimbra</em></strong>&#8216;s admin API for one of my projects, and quickly realized that it is er.. a little weird. You see, Zimbra has a <strong>SOAP</strong> (and also a limited <strong>REST</strong>) API, but does not does not publish a <strong>WSDL</strong> for them. Neither is an xsd or DTD available to validate your requests against or to generate client stubs. To make things worse, the only documentation available is a lengthy but simple text file which lists the available operation names as tags and the attributes / elements that go with each of them. In case you are interested in this file, you can find it in the docs folder of your Zimbra installation.<br />
<span id="more-306"></span><br />
The first thing I tried was, of course, to try and flesh out my own, but quickly realized that I was going to miss my project deadline if I went that route. I then remembered that Zimbra already has a Java client. Aha! So I checked the project out from the repository and started exploring the source code. The code encapsulated each operation into a request and a response object, which were really extensions of their parent templates. The algorithm for interfacing with the server was implemented in these abstract parent classes, and each sub class overrode a couple of methods and provided the behaviour specific to each operation. While the source code gave me great insight into the inner workings of the API, one problem still remained.</p>
<p>All the operations available in the API are segregated into one of two sections, the mailbox (user) side and the admin side. The problem was that the Zimbra client only had implementations for the user set of APIs, and I needed to interface with the admin side of things.</p>
<p>So I went back to Google, and this time stumbled upon this great piece of work done by the folks running this website <a title="Zimbra Admin SOAP WSDL" href="http://marsorange.com/archives/wsdl-for-zimbra-the-beginning" target="_blank">here</a>. These folks must have been in the same boat as me a while back, and they actually managed to roll out their own WSDL for the admin api. Awesome! I finally had something concrete to work with. I quickly downloaded the wsdl and pointed CXF&#8217;s wsdl2java at it. Alas, it wasn&#8217;t that easy. The folks who wrote this seem to be Rubyists, and even though they claim it works with their Ruby client builder script, none of the Java implementations agreed with them.</p>
<p>So I fired up Eclipse, and had to apply a bunch of fixes, most of them related to namespaces and element ordering, before I had a file that validated perfectly. I also added a couple more operations that I thought I would need while I was at it. Note that all available operations still haven&#8217;t been implemented. If you do improve on it, please report back so I can update the file and others could benefit as well. This file has been tested to work with <strong>ZCS 6 and 7</strong>.</p>
<p>So there you have it folks, without any further ado, I present the elusive Java compliant WSDL for Zimbra&#8217;s SOAP API.</p>
<p>You can download the WSDL file <strong><a title="Java Compliant Zimbra WSDL" href="http://blog.jeshurun.ca/wp-content/uploads/2011/12/zimbra.wsdl" target="_blank">here</a></strong>.</p>
<p>Last time I checked Java 6&#8242;s wsimport and wsgen were still complaining about something in the file, so I also zipped up the proxy client stubs generated by CXF 2.5, which can be downloaded <strong><a title="Zimbra Admin Java Client Proxies" href="http://blog.jeshurun.ca/wp-content/uploads/2011/12/zimbra-admin-client-proxies.jar" target="_blank">here</a></strong>.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/a-java-compliant-wsdl-for-zimbras-admin-soap-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Apps Fire Sale</title>
		<link>http://blog.jeshurun.ca/random-scribblings/android-apps-fire-sale</link>
		<comments>http://blog.jeshurun.ca/random-scribblings/android-apps-fire-sale#comments</comments>
		<pubDate>Wed, 07 Dec 2011 02:40:12 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Random Scribblings]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Fire Sale]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=290</guid>
		<description><![CDATA[The Android marked reached 10 Billion downloads today, and to celebrate, Google is offering some quality apps for the next 10 days for 10¢ a piece! If your current device doesn&#8217;t support an app you would like to purchase, but you would like to get it anyway, say because you plan to upgrade in the [...]]]></description>
			<content:encoded><![CDATA[<p>The Android marked reached <strong>10 Billion</strong> downloads today, and to celebrate, Google is offering some quality apps for the next <strong>10 days</strong> for <strong>10¢</strong> a piece!</p>
<div id="attachment_291" class="wp-caption alignnone" style="width: 563px"><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/12/graph_only_3.jpg"><img class="size-full wp-image-291   " title="graph_only_3" src="http://blog.jeshurun.ca/wp-content/uploads/2011/12/graph_only_3.jpg" alt="Android Market's Exponential Growth" width="553" height="553" /></a><p class="wp-caption-text">Android Market&#39;s Exponential Growth</p></div>
<p>If your current device doesn&#8217;t support an app you would like to purchase, but you would like to get it anyway, say because you plan to upgrade in the near future, you could still get the app from the online store at this link: <a title="Online Marketplace" href="https://market.android.com/details?feature=banne­r&amp;id=apps_timed_promotion" target="_blank">https://market.android.com/details?feature=banne­r&amp;id=apps_timed_promotion</a></p>
<p>Here is the list of fire sale apps for 6/12/2011:</p>
<ol>
<li>SoundHound</li>
<li>Asphalt 6: Adrenaline HD</li>
<li>Minecraft &#8211; Pocket Edition (yep!)</li>
<li>SwiftKey X Keyboard</li>
<li>Endomondo Sports Tracker PRO</li>
<li>Great Little War Game</li>
<li>SketchBook Mobile</li>
<li>Fieldrunners HD</li>
<li>Color &amp; Draw for kids: phone ed</li>
<li>Paper Camera</li>
</ol>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/random-scribblings/android-apps-fire-sale/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alienware M14x Unboxing (Pictures)</title>
		<link>http://blog.jeshurun.ca/random-scribblings/alienware-m14x-unboxing</link>
		<comments>http://blog.jeshurun.ca/random-scribblings/alienware-m14x-unboxing#comments</comments>
		<pubDate>Mon, 05 Dec 2011 01:07:19 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Random Scribblings]]></category>
		<category><![CDATA[alienware]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[m14x]]></category>
		<category><![CDATA[unboxing]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=258</guid>
		<description><![CDATA[I&#8217;ll just let the pictures do the talking on this one.. Also check out how this baby reboots in under 20 seconds: So who is hoping to find one of these under the Christmas tree? Stay tuned for our next post where we rip it apart and apply some quality thermal paste to keep it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll just let the <strong>pictures</strong> do the talking on this one..</p>
<div class="ngg-galleryoverview" id="ngg-gallery-1-258">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://blog.jeshurun.ca/random-scribblings/alienware-m14x-unboxing?show=slide">
			[Show as slideshow]		</a>
	</div>

	
	<!-- Thumbnails -->
		
	<div id="ngg-image-28" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/1.jpg" title="Outer Box" class="shutterset_set_1" >
								<img title="Outer Box" alt="Outer Box" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_1.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-29" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/2.jpg" title="Flipping the flap open we are greeted by the all to familiar Alienhead Logo" class="shutterset_set_1" >
								<img title="Inner Box" alt="Inner Box" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_2.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-30" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/3.jpg" title="The Inner Box houses the Charger and Resource DVDs" class="shutterset_set_1" >
								<img title="Inner Box Contents" alt="Inner Box Contents" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_3.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-31" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/4.jpg" title="The inner box also holds the Resource and OS DVDs which I usually need once in about every three months to re-install Windows when it tanks, and the Manual which usually never leaves its packaging" class="shutterset_set_1" >
								<img title="Resource DVDs and the Manual" alt="Resource DVDs and the Manual" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_4.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-32" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/5.jpg" title="The machine itself is wrapped in a velvet bag to keep the dust away and held securely by two huge pieces of foam." class="shutterset_set_1" >
								<img title="The most valuable item in the box is housed securely" alt="The most valuable item in the box is housed securely" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_5.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-33" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/6.jpg" title="The back side of the lid, covered in lovely soft rubbery coating that doesn't stays shiny no matter how messy your palms may be." class="shutterset_set_1" >
								<img title="Sliding it out of its velvet cover..." alt="Sliding it out of its velvet cover..." src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_6.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-34" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/7.jpg" title="We see the HD screen, and the keyboard that is simply a joy to type on." class="shutterset_set_1" >
								<img title="Flipping the lid open.." alt="Flipping the lid open.." src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_7.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-35" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/8.jpg" title="The thing boots into Windows in under 10 seconds.." class="shutterset_set_1" >
								<img title="Firing er up..." alt="Firing er up..." src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_8.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-36" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/9.jpg" title="And of course, no Alienware unboxing would be complete without a light show" class="shutterset_set_1" >
								<img title="Lights show" alt="Lights show" src="http://blog.jeshurun.ca/wp-content/gallery/m14x_unboxing/thumbs/thumbs_9.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

<p>Also check out how this baby reboots in under 20 seconds:</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/lYz7aXAQ0a8?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>So who is hoping to find one of these under the Christmas tree? Stay tuned for our next post where we rip it apart and apply some quality thermal paste to keep it running cool..</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/random-scribblings/alienware-m14x-unboxing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JAX-WS Web Services with Spring and Apache CXF</title>
		<link>http://blog.jeshurun.ca/technology/jax-ws-web-services-with-spring-and-cxf</link>
		<comments>http://blog.jeshurun.ca/technology/jax-ws-web-services-with-spring-and-cxf#comments</comments>
		<pubDate>Mon, 28 Nov 2011 13:16:19 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cxf]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jax-ws]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=229</guid>
		<description><![CDATA[I recently had to evaluate CXF to expose existing services in a Spring project. I thought I would jot down my thoughts and conclusions from my experiments with the technology, and log my experience as a quick tutorial for fellow coders. Prerequisites: I use the Eclipse IDE but any IDE of your choice should suffice [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to evaluate CXF to expose existing services in a Spring project. I thought I would jot down my thoughts and conclusions from my experiments with the technology, and log my experience as a quick tutorial for fellow coders.</p>
<p><span id="more-229"></span></p>
<p><strong>Prerequisites</strong>:</p>
<ul>
<li>I use the Eclipse IDE but any IDE of your choice should suffice as long as you know your way around.</li>
<li>Download Spring 3 from <a title="Spring" href="http://www.springsource.org/download" target="_blank">here</a> and download CXF 2.5 from <a title="CXF" href="http://cxf.apache.org/download.html" target="_blank">here</a>.</li>
<li>Create a working install of Tomcat in your IDE or standalone.</li>
<li>Intermediate working knowledge of Java is assumed.</li>
</ul>
<p><strong>Project Setup</strong>:</p>
<ul>
<li>Create a new Dynamic Web project in Eclipse.</li>
<li>Add the following JARs from your Spring and CXF downloads into the lib folder:</li>
</ul>
<pre class="brush: plain; title: ; notranslate">
spring-asm-3.0.6.RELEASE.jar
spring-beans-3.0.6.RELEASE.jar
spring-context-3.0.6.RELEASE.jar
spring-context-support-3.0.6.RELEASE.jar
spring-core-3.0.6.RELEASE.jar
spring-web-3.0.6.RELEASE.jar
commons-logging-1.1.1.jar
wsdl4j-1.6.2.jar
wss4j-1.6.3.jar
xml-resolver-1.2.jar
xmlschema-core-2.0.1.jar
xmlsec-1.4.5.jar
jaxrpc.jar
saaj.jar
saaj-api-1.3.jar
cxf-2.5.0.jar
bcprov-jdk16-146.jar
serializer-2.7.1.jar
xalan-2.7.1.jar
dom4j-1.6.1.jar
</pre>
<p>When creating web services, two approaches are possible: Contract-first and Contract-last. In contract-first, you define the service contract in WSDL (Web Service Definition Language) first, and then implement your service to the contract. This approach is better suited for newer projects. However, since the project I was working on already had the Java code written, the contract-last approach was a better choice, which is also what I will be explaining here.</p>
<p><strong>The Server:</strong></p>
<p>First up is our Java class, GreetingService. The service defines a single method, greet. It accepts a username and returns a greeting to the caller as a String (I know, I apologize for my lack of imagination).</p>
<pre class="brush: java; title: ; notranslate">
package test;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

/**
 *
 * @author JD
 *
 */
@WebService(name = &quot;GreetingService&quot;, targetNamespace = &quot;http://test/&quot;)
public class GreetingService {

	@WebMethod
	public @WebResult(name = &quot;greeting&quot;)
	String greet(@WebParam(name = &quot;user&quot;) String user) {
		return &quot;Hi there, &quot; + user + &quot;!&quot;;
	}

}
</pre>
<p>As you can see, this is a POJO with some annotations sprinkled in. The only required annotation would be @WebService.<br />
Everything else simply assists in generating cleaner WSDL. For example, without the @WebParam annotation, the names of method arguments would be replaced with arg0, etc, making life a little difficult for a client.</p>
<p>Next up is our Spring configuration file, which will contain instructions for CXF to expose our service as a web service. Save this as a file named cxfContext.xml and put it in the WEB-INF directory.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:jaxws=&quot;http://cxf.apache.org/jaxws&quot;
	xmlns:soap=&quot;http://cxf.apache.org/bindings/soap&quot; xmlns:cxf=&quot;http://cxf.apache.org/core&quot;
	xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd&quot;&gt;

	&lt;!-- Interceptors --&gt;
	&lt;bean id=&quot;logIn&quot; class=&quot;org.apache.cxf.interceptor.LoggingInInterceptor&quot; /&gt;
	&lt;bean id=&quot;logOut&quot; class=&quot;org.apache.cxf.interceptor.LoggingOutInterceptor&quot; /&gt;
	&lt;!-- SAAJ Interceptor needs to be explicitly declared only in CXF 2.0.x --&gt;
	&lt;bean id=&quot;saajIn&quot; class=&quot;org.apache.cxf.binding.soap.saaj.SAAJInInterceptor&quot; /&gt;
	&lt;bean id=&quot;wss4jIn&quot; class=&quot;org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor&quot;&gt;
		&lt;constructor-arg&gt;
			&lt;map&gt;
				&lt;entry key=&quot;action&quot; value=&quot;UsernameToken Timestamp&quot; /&gt;
				&lt;entry key=&quot;passwordType&quot; value=&quot;PasswordText&quot; /&gt;
			&lt;/map&gt;
		&lt;/constructor-arg&gt;
	&lt;/bean&gt;

	&lt;!-- The CXF Bus --&gt;
	&lt;cxf:bus&gt;
		&lt;cxf:features&gt;
			&lt;cxf:logging /&gt;
		&lt;/cxf:features&gt;

		&lt;cxf:properties&gt;
			&lt;entry key=&quot;ws-security.validate.token&quot; value=&quot;false&quot; /&gt;
			&lt;entry key=&quot;ws-security.ut.no-callbacks&quot; value=&quot;true&quot; /&gt;
			&lt;entry key=&quot;ws-security.ut.validator&quot; value=&quot;test.UTValidator&quot; /&gt;
		&lt;/cxf:properties&gt;

		&lt;cxf:inInterceptors&gt;
			&lt;ref bean=&quot;logIn&quot; /&gt;
		&lt;/cxf:inInterceptors&gt;
		&lt;cxf:outInterceptors&gt;
			&lt;ref bean=&quot;logOut&quot; /&gt;
		&lt;/cxf:outInterceptors&gt;
		&lt;cxf:inFaultInterceptors&gt;
			&lt;ref bean=&quot;logIn&quot; /&gt;
		&lt;/cxf:inFaultInterceptors&gt;
		&lt;cxf:outFaultInterceptors&gt;
			&lt;ref bean=&quot;logOut&quot; /&gt;
		&lt;/cxf:outFaultInterceptors&gt;
	&lt;/cxf:bus&gt;

	&lt;!-- End points --&gt;
	&lt;jaxws:endpoint id=&quot;greeter&quot; serviceName=&quot;GreetingService&quot;
		implementor=&quot;test.GreetingService&quot; address=&quot;/&quot;&gt;
		&lt;!-- wsdlLocation=&quot;WEB-INF/wsdl/library.wsdl&quot; This will be generated automcatically
			when not specified --&gt;
		&lt;jaxws:inInterceptors&gt;
			&lt;ref bean=&quot;saajIn&quot; /&gt;
			&lt;ref bean=&quot;wss4jIn&quot; /&gt;
		&lt;/jaxws:inInterceptors&gt;
	&lt;/jaxws:endpoint&gt;

&lt;/beans&gt;
</pre>
<p>Lines 10 &#8211; 21 define the required interceptors for implementing WS-Security via the WSS4JInInterceptor and for logging. Line 50 defines the end point. Details on the attributes can be found <a title="Endpoint Configuration Wiki" href="https://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html" target="_blank">here</a> Notice how everything can be configured in a very Spring-like way thanks to the custom namespaces. Also note how common properties for all endpoints, such as logging interceptors and properties can be defined in the bus and don&#8217;t have to be repeated for each endpoint.</p>
<p>The
<pre class="brush: xml; title: ; notranslate">&lt;cxf:properties&gt;</pre>
<p> element specifies a set of properties for the bus. Here we are saying we will be handling authentication ourselves, via ws-security.ut.validator key in the UTValidator class, and that no password callback handlers are required by setting ws-security.validate.token to true. If you use a different password scheme other than PasswordText, like PasswordDigest, you would have to set the plain text password from the digest in the password callback class. Note that the properties can also be overridden per endpoint using the
<pre class="brush: xml; title: ; notranslate">&lt;jaxws:properties&gt;</pre>
<p> child element of
<pre class="brush: xml; title: ; notranslate">&lt;jaxws:endpoint&gt;</pre>
<p>.</p>
<p>The authentication method we have chosen here is UserNameToken, which validates a username and password provided by the client, and Timestamp. While this is sufficient for development and testing, this needs to be beefed up by either encrypting the transport(https) or by using security tokens in production.</p>
<p>The UTValidator is simply a subclass of CXF&#8217;s UsernameTokenValdator, and overrides the verifyPlaintextPassword method to provide custom authentication. In a real world application, an authentication service such as one that validates the credentials provided against a directory such as LDAP can be used. If validation fails, this method must throw a WSSecurityException with the error code (the first constructor argument) set as WSSecurityException.FAILURE.</p>
<pre class="brush: java; title: ; notranslate">
package test;

import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.UsernameToken;
import org.apache.ws.security.validate.UsernameTokenValidator;

public class UTValidator extends UsernameTokenValidator {

	@Override
	protected void verifyPlaintextPassword(UsernameToken usernameToken,
			RequestData data) throws WSSecurityException {
		// usernameToken.getName(), usernameToken.getPassword(), authenticate against
		// directory store or database. Do nothing if successful. Throw
		// throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION); on failure.
	}

}
</pre>
<p>The final configuration on the server side is the web.xml file, which will initialize the Spring context, pass in our own Spring context as well as a couple from CXF (which are in its own jar files) to the ContextLoaderListener, and finally setup the CXF servlet which will handle all incoming requests for our service.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
	xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;
	version=&quot;3.0&quot;&gt;
	&lt;display-name&gt;jax-ws-spring-test&lt;/display-name&gt;

	&lt;context-param&gt;
		&lt;!-- Spring contexts --&gt;
		&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
		&lt;param-value&gt;
			classpath:META-INF/cxf/cxf.xml
      		        classpath:META-INF/cxf/cxf-servlet.xml
      		        /WEB-INF/cxfContext.xml
		&lt;/param-value&gt;
	&lt;/context-param&gt;

	&lt;!-- Listener which bootstraps the Spring config files --&gt;
	&lt;listener&gt;
		&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
	&lt;/listener&gt;

	&lt;!-- The CXF Servlet --&gt;
	&lt;servlet&gt;
		&lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
		&lt;servlet-class&gt;org.apache.cxf.transport.servlet.CXFServlet&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;
	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
		&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;

&lt;/web-app&gt;
</pre>
<p>And thats it! Now if you were to fire up your server, package the project as a war and deploy it on the server, your web service should be up and running. You can verify this by navigation to http://localhost:8080/<your_project_name>/greetingservice?wsdl on your browser to view the WSDL that is automatically generated by CXF based on the JAX-WS annotations defined in your service class.</p>
<p><strong>The Client:</strong></p>
<p>To test the service, create a second Dynamic web project, and use the same build path as the previous project. </p>
<p>What we will need to create a working client to test the service:</p>
<ol>
<li>
The service interface which will be proxied by Spring.
</li>
<li>
A spring context configuration file to define the jaxws client proxy for the service.
</li>
<li>
A password callback handler which will supply the authentication token when invoking the service
</li>
<li>
A simple spring bean to test the proxy and invoke the greet operation.
</li>
</ol>
<p>The service interface can be generated from the WSDL either by CXF&#8217;s wsdl2java tool or Java 6&#8242;s wsimport utility. The source below was generated by wsimport when invoked as follows:</p>
<pre class="brush: plain; title: ; notranslate">
wsimport -d . -keep http://localhost:8080/jax-ws-spring-test/greetingservice?wsdl
</pre>
<pre class="brush: java; title: ; notranslate">

package test;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.1.6 in JDK 6
 * Generated source version: 2.1
 *
 */
@WebService(name = &quot;GreetingService&quot;, targetNamespace = &quot;http://test/&quot;)
public interface GreetingService {

    /**
     *
     * @param user
     * @return
     *     returns java.lang.String
     */
    @WebMethod
    @WebResult(name = &quot;greeting&quot;, targetNamespace = &quot;&quot;)
    @RequestWrapper(localName = &quot;greet&quot;, targetNamespace = &quot;http://test/&quot;, className = &quot;test.Greet&quot;)
    @ResponseWrapper(localName = &quot;greetResponse&quot;, targetNamespace = &quot;http://test/&quot;, className = &quot;test.GreetResponse&quot;)
    public String greet(
        @WebParam(name = &quot;user&quot;, targetNamespace = &quot;&quot;)
        String user);

}
</pre>
<p>The client Spring context contains the client proxy definition and is shown next:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:jaxws=&quot;http://cxf.apache.org/jaxws&quot;
	xmlns:soap=&quot;http://cxf.apache.org/bindings/soap&quot; xmlns:cxf=&quot;http://cxf.apache.org/core&quot;
	xsi:schemaLocation=&quot;
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd&quot;&gt;

	&lt;!-- Interceptors --&gt;
	&lt;bean id=&quot;logIn&quot; class=&quot;org.apache.cxf.interceptor.LoggingInInterceptor&quot; /&gt;
	&lt;bean id=&quot;logOut&quot; class=&quot;org.apache.cxf.interceptor.LoggingOutInterceptor&quot; /&gt;
	&lt;bean id=&quot;saajOut&quot; class=&quot;org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor&quot; /&gt;
	&lt;bean id=&quot;wss4jOut&quot; class=&quot;org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor&quot;&gt;
		&lt;constructor-arg&gt;
			&lt;map&gt;
				&lt;entry key=&quot;action&quot; value=&quot;UsernameToken Timestamp&quot; /&gt;
				&lt;entry key=&quot;user&quot; value=&quot;ws-client&quot; /&gt;
				&lt;entry key=&quot;passwordType&quot; value=&quot;PasswordText&quot; /&gt;
				&lt;entry key=&quot;passwordCallbackClass&quot; value=&quot;test.PWCallbackHandler&quot; /&gt;
			&lt;/map&gt;
		&lt;/constructor-arg&gt;
	&lt;/bean&gt;

	&lt;!-- The CXF Bus --&gt;
	&lt;cxf:bus&gt;
		&lt;cxf:features&gt;
			&lt;cxf:logging /&gt;
		&lt;/cxf:features&gt;

		&lt;cxf:inInterceptors&gt;
			&lt;ref bean=&quot;logIn&quot; /&gt;
		&lt;/cxf:inInterceptors&gt;
		&lt;cxf:outInterceptors&gt;
			&lt;ref bean=&quot;logOut&quot; /&gt;
		&lt;/cxf:outInterceptors&gt;
		&lt;cxf:inFaultInterceptors&gt;
			&lt;ref bean=&quot;logIn&quot; /&gt;
		&lt;/cxf:inFaultInterceptors&gt;
		&lt;cxf:outFaultInterceptors&gt;
			&lt;ref bean=&quot;logOut&quot; /&gt;
		&lt;/cxf:outFaultInterceptors&gt;
	&lt;/cxf:bus&gt;

	&lt;!-- Client Proxies --&gt;
	&lt;jaxws:client
		name=&quot;{http://www.springframework.org/schema/beans}GreetingService&quot;
		address=&quot;http://localhost:8080/&lt;your_project_name&gt;/greetingservice?wsdl&quot;
		serviceClass=&quot;test.GreetingService&quot;
		wsdlLocation=&quot;http://localhost:8080/&lt;your_project_name&gt;/greetingservice?wsdl&quot;
		serviceName=&quot;GreetingService&quot; endpointName=&quot;GreetingServicePort&quot;&gt;

		&lt;jaxws:outInterceptors&gt;
			&lt;ref bean=&quot;saajOut&quot; /&gt;
			&lt;ref bean=&quot;wss4jOut&quot; /&gt;
		&lt;/jaxws:outInterceptors&gt;
	&lt;/jaxws:client&gt;

&lt;/beans&gt;
</pre>
<p>Make sure you replace <your_project_name> with the name of your project in the snippet above. Worthy of note is how the InInterceptors on the Server side are mirrored by OutInterceptors on the client side.</p>
<p>The PWCallbackHandler is an implementation of a CallbackHandler, and is responsible for providing the password to be encoded in the soap request header. Note that by calling the setIdentifier method, a different username can also be set. This allows for specifying different credentials per request. In a real world client, these values would probably come from a Session variable or from a SessionContextHolder.</p>
<pre class="brush: java; title: ; notranslate">
package test;

import java.io.IOException;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;

import org.apache.ws.security.WSPasswordCallback;

public class PWCallbackHandler implements CallbackHandler {

	@Override
	public void handle(Callback[] callbacks) throws IOException,
			UnsupportedCallbackException {
		WSPasswordCallback c = (WSPasswordCallback) callbacks[0];
		// in a real world client these would probably come from SecurityContextHolder
		// or some session object
		c.setIdentifier(&quot;jd&quot;);
		c.setPassword(&quot;secret&quot;);
	}

}
</pre>
<p>The Web.xml will contain the same content as the one from the server project.</p>
<p>Finally, we create a spring bean which will have the proxy injected, and will then call the greet method on the service:</p>
<pre class="brush: java; title: ; notranslate">
package test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
@Qualifier(&quot;greetingServiceClient&quot;)
public class GreetingServiceClient {

	@Autowired
	private GreetingService gs;

	@Scheduled(cron=&quot;0 m h * * ?&quot;)
	public void testService() {
		try {
			System.out.println(gs.greet(&quot;Jeshurun&quot;));;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
</pre>
<p>Adjust the cron task by replacing the h with the hour of your current time, and m with two minutes plus your current time&#8217;s minute.</p>
<p>Deploying the project on the server, and waiting for the cron to kick in should print &#8220;Hi there, Jeshurun!&#8221;. You can even deploy the client on a separate machine to make it even more awesome.</p>
<p>To sum things up, lets see how CXF stacks up against other popular stacks:</p>
<ol>
<li>Easy Spring integration by using custom namespaces.</li>
<li>Modular, lets you pick and choose eactly the features you need.</li>
<li>Setting up security is relatively easy.</li>
<li>Uses standard JAX-WS annotations, so your services can be ported easily to a different stack if needed.</li>
<li>Way better documentation compared to Metro, although not on par with Spring (but definitely getting there).</li>
<li>Performance is comparable to Metro and is faster than Axis.</li>
<li>Can be integrated right into your project and doesn&#8217;t force you to deploy each service as a separate war.
</ol>
<p>Some of the cons for me, which are making me think twice about using it:</p>
<ol>
<li>There seems to be no easy way of defining the jaxws:endpoint or jaxws:client as an abstract bean and create beans which inherit common properties. Because of this, properties such as interceptors have to be redefined for every endpoint or client definition, even when they are exactly the same. This could make your configuration xml lengthy and error-prone in larger projects.</li>
<li>Can&#8217;t be configured to automagically detect POJOs annotated with @WebService and publish them, like Spring&#8217;s SimpleJaxWsServiceExporter.</li>
</ol>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/jax-ws-web-services-with-spring-and-cxf/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bitten by the Java TreeMap removeAll bug</title>
		<link>http://blog.jeshurun.ca/technology/bitten-by-the-java-treemap-removeall-bug</link>
		<comments>http://blog.jeshurun.ca/technology/bitten-by-the-java-treemap-removeall-bug#comments</comments>
		<pubDate>Fri, 15 Apr 2011 02:18:49 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=205</guid>
		<description><![CDATA[I had to learn the hard way today about the nasty issue surrounding Java&#8217;s TreeSet / TreeMap implementations. The problem is that the removeAll method doesn&#8217;t always do what it says it does: remove all elements present in the collection called on that are present in the collection passed as the argument. Supposedly the problem [...]]]></description>
			<content:encoded><![CDATA[<p>I had to learn the hard way today about the nasty issue surrounding Java&#8217;s TreeSet / TreeMap implementations. The problem is that the removeAll method doesn&#8217;t always do what it says it does: remove <em>all</em> elements present in the collection called on that are present in the collection passed as the argument. </p>
<p>Supposedly the problem occurs when the equals and compareTo method in the type contained in the Collections aren&#8217;t consistent with each other, and the sizes of the collections compared aren&#8217;t equal. Look at the following link for an example<br />
<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6394757">JDK Bug 6394757</a> : (coll) AbstractSet.removeAll is surprisingly dependent on relative collection sizes.</p>
<p>Anyways, the rule of thumb for me from now is if need be to implement a SortedSet Set that will have either removeAll or retainAll called on, use an HashSet instead, and later use Collections.sort</p>
<pre class="brush: java; title: ; notranslate">
Set&lt;MyType&gt; mySet = new HashSet&lt;MyType&gt;();
// add some elements, do some operations
mySet.removeAll(anotherCollection);
List&lt;MyType&gt; myList = new ArrayList&lt;MyType&gt;(mySet);
Collections.sort(myList);
</pre>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/bitten-by-the-java-treemap-removeall-bug/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[SOLD] Sony Ericsson Xperia X10 for sale</title>
		<link>http://blog.jeshurun.ca/random-scribblings/sony-ericsson-xperia-x10-for-sale</link>
		<comments>http://blog.jeshurun.ca/random-scribblings/sony-ericsson-xperia-x10-for-sale#comments</comments>
		<pubDate>Sat, 08 Jan 2011 06:39:54 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Random Scribblings]]></category>
		<category><![CDATA[Android 2.1]]></category>
		<category><![CDATA[sale]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[Xperia X10]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=173</guid>
		<description><![CDATA[Update: The phone has been sold. Thanks to all who were interested. After much thought I have decided to sell my Xperia X10. I have only had the phone for a few months, but as I develop apps for Android, I need a phone with the latest Android version. I&#8217;ve attached some pictures below, and [...]]]></description>
			<content:encoded><![CDATA[<p>Update: The phone has been sold. Thanks to all who were interested.</p>
<p>After much thought I have decided to sell my Xperia X10. I have only had the phone for a few months, but as I develop apps for Android, I need a phone with the latest Android version.<a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01559.jpg"><img class="alignright size-thumbnail wp-image-170" title="DSC01559" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01559-150x150.jpg" alt="" width="120" height="120" /></a></p>
<p>I&#8217;ve attached some pictures below, and as you can see from them, the phone is in excellent shape and has no scratches on the body. I&#8217;ve always used a screen guard so the screen has no scratches as well, and I also have a new spare screen guard which I will give with the phone.</p>
<p>The phone comes with a 16GB microSD memory card. I&#8217;ve never used the headphones that came with it. My asking price is <strong>$315 + shipping</strong>. Click on the images to view them in full resolution.</p>
<p>Check out the pictures below:<br />
<span id="more-173"></span></p>
<p><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01558.jpg"><img class="alignleft size-large wp-image-169" title="DSC01558" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01558-1024x768.jpg" alt="" width="614" height="461" /></a> <a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01557.jpg"><img class="alignleft size-large wp-image-168" title="DSC01557" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01557-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01565.jpg"><img class="alignleft size-large wp-image-171" title="DSC01565" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01565-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01567.jpg"><img class="alignleft size-large wp-image-172" title="DSC01567" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01567-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01551.jpg"><img class="alignleft size-large wp-image-166" title="DSC01551" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01551-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01556.jpg"><img class="alignleft size-large wp-image-167" title="DSC01556" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/DSC01556-1024x768.jpg" alt="" width="614" height="461" /></a></p>
<p><strong>Other Specifications:</strong><br />
2G Network: GSM 850 / 900 / 1800 / 1900<br />
3G HSDPA: 850 / 1900 / 2100 / 800 &#8211; X10a for Americas<br />
Display: 480 x 854 pixels, 4.0 inches TFT capacitive touchscreen<br />
Memory: 1 GB storage, 384 MB RAM<br />
Card slot: microSD, up to 32GB, 16GB card included<br />
Data: 3G, EDGE, GPRS, HSDPA, Wi-Fi, Bluetooth, USB 2.0<br />
Camera: 8 MP, 3264&#215;2448 pixels, autofocus, LED flash<br />
Operating System: Android OS 2.1</p>
<p><a href="http://www.gsmarena.com/sony_ericsson_xperia_x10-2964.php" target="_blank">Full Specifications</a></p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/random-scribblings/sony-ericsson-xperia-x10-for-sale/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phishing emails running rampant this holiday season</title>
		<link>http://blog.jeshurun.ca/random-scribblings/phishing-emails-running-rampant-this-holiday-season</link>
		<comments>http://blog.jeshurun.ca/random-scribblings/phishing-emails-running-rampant-this-holiday-season#comments</comments>
		<pubDate>Tue, 04 Jan 2011 05:47:58 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Random Scribblings]]></category>
		<category><![CDATA[email scam]]></category>
		<category><![CDATA[phishing email]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=149</guid>
		<description><![CDATA[Ever since the holiday season started I have been receiving a hoard of phishing emails both on my personal and work email accounts. The emails seem to be after my bank account and either state that the bank believes my account has been compromised and I need to re-enter all my details on the website [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since the holiday season started I have been receiving a hoard of phishing emails both on my personal and work email accounts. The emails seem to be after my bank account and either state that the bank believes my account has been compromised and I need to re-enter all my details on the website at the link given below to &#8216;fully reactivate&#8217; my account, or that I need to enter them to &#8216;update&#8217; my account to benefit from the banks &#8216;new security features&#8217;.</p>
<p>What is interesting is that I started receiving these emails soon after of my credit card was used fraudulently online to purchase merchandise from stores in France. Thankfully, my bank refunded  the purchases and issued me a new card.</p>
<p>Below is an screenshot of a phishing email masquerading to be from TD Canada Bank:<span id="more-149"></span><a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/td_phishing_email.jpg"><img class="size-large wp-image-150 " title="td_phishing_email" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/td_phishing_email-1024x582.jpg" alt="TD Bank Phishing Email" width="614" height="349" /></a></p>
<div class="mceTemp">
<dl id="attachment_150" class="wp-caption alignleft" style="width: 624px;">
<dd class="wp-caption-dd">An example of a phishing email that appears to be from TD Canada Bank</dd>
</dl>
</div>
<p>While phishing emails like these can be very much like the real thing, a little diligence can go a long way to help spot these as fake right away. Here are a few pointers from the image above that might help spot a fake email:</p>
<ol>
<li>The email has a generic greeting. In this case its &#8220;Dear TD Canada Trust Valued Customer&#8221;. If the email were legitimately from your bank, they would know who you are, and would address the email to your name.</li>
<li>The link in the email is fraudulent. Although the link text seems to indicate that it leads to the actual TD site, it doesn&#8217;t. How do you identify this? Its simple. Just hover your mouse over the link and you would notice that it actually points to a completely different domain. And the link is not secure either (uses http:// instead of https://). The actual link is usually visible on your browser or email client&#8217;s status bar. Keep in mind though that the website this link leads to will be almost identical to the real thing.<br />
<a href="http://blog.jeshurun.ca/wp-content/uploads/2011/01/phishing_link.jpg"><img class="alignleft size-full wp-image-153" title="phishing_link" src="http://blog.jeshurun.ca/wp-content/uploads/2011/01/phishing_link.jpg" alt="" width="584" height="81" /></a></li>
<li>There is almost always a sense of urgency in the email.</li>
<li>The emails are usually riddled with typos / grammatical errors.</li>
</ol>
<p>Here is a similar email for RBC. Unfortunately I deleted mine so this image is courtesy of Google.<br />
<img src='http://www.millersmiles.co.uk/images/reports/email/0612056.gif' /></p>
<p>And this is the scam website it links to:<br />
<img src='http://www.millersmiles.co.uk/images/reports/web/0612056.gif' /></p>
<p>A few pointers that might help keep you from getting scammed:</p>
<ol>
<li> Buy a reputed anti-virus product (Kaspersky is my personal favourite) if you don&#8217;t have one already and keep it updated all the time, if you are running Windows.</li>
<li>Don&#8217;t ever open unsolicited email from senders you don&#8217;t know / trust. The holiday season is prime time for amazing deals / offers that will entice you to drop your guard. Remember, the old adage still holds, &#8220;if its too good to be true, it probably isn&#8217;t&#8221;.</li>
<li>Switch to Linux! Well, at least when you are logging into your bank&#8217;s website / making purchases with your credit card. Most, if not all of these phishing emails and almost all viruses out there are targeted towards Windows users. Switching to Linux saves you a lot of pain as these Windows executable viruses have no impact on a Linux machine. Plus you can get away with not using an anti-virus. And its free! If you need Windows for a proprietary program such as Microsoft Office, you can always run Windows in a virtual machine such as VMware player.</li>
<li>If you think your financial information might have been compromised, contact your bank immediately.</li>
</ol>
<p>If you have already fallen for one of these scams, don&#8217;t feel embarrassed! An <a href="http://www.neowin.net/news/spoofed-ecard-from-the-whitehouse-stole-government-data" target="_blank">eCard that was spoofed as being sent from the Whitehouse</a> conned several employees of the US government this holiday season and stole several gigabytes of sensitive government data. This only shows that sometimes, even the experts can fall for these scams, although it beats me why the US government hasn&#8217;t heard of a simple thing called SPF yet!</p>
<p>Stay safe online this new year!</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/random-scribblings/phishing-emails-running-rampant-this-holiday-season/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPBB Admin Panel Access Denied</title>
		<link>http://blog.jeshurun.ca/technology/phpbb-admin-panel-access-denied</link>
		<comments>http://blog.jeshurun.ca/technology/phpbb-admin-panel-access-denied#comments</comments>
		<pubDate>Mon, 20 Dec 2010 22:45:02 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[access denied]]></category>
		<category><![CDATA[phpbb3]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=127</guid>
		<description><![CDATA[There seems to be a bug with the latest version of PHPBB3. After a fresh install, if you log out, log back in and try to access the administrative panel you might get the message &#8220;Access to the Administration Control Panel is not allowed as you do not have administrative permissions&#8221;. I&#8217;m not sure why [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be a bug with the latest version of PHPBB3. After a fresh install, if you log out, log back in and try to access the administrative panel you might get the message &#8220;Access to the Administration Control Panel is not allowed as you do not have administrative permissions&#8221;.</p>
<p>I&#8217;m not sure why this happens (and I haven&#8217;t had time to dig into the source, perhaps I will file a bug report when time permits), but to get around this the following steps worked:</p>
<ol>
<li>Make sure you have remove the install directory.</li>
<li> Login to the front end.</li>
<li>Click on the &#8220;members&#8221; link on the top right and then click on the site admin&#8217;s username.</li>
<li>Right beside the username you should see a link which says [ Administrate user ]. Click on the link.</li>
<li>Re-authenticate yourself.</li>
<li>Click on proceed to acp.</li>
<li>You should now be looking at the admin panel.</li>
</ol>
<p>Did this work for you? Do let me know in the comments below!</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/phpbb-admin-panel-access-denied/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

