<?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>Yet Another Tech Blog</description>
	<lastBuildDate>Thu, 19 Jan 2012 06:03:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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>3</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>
		<item>
		<title>Zimbra &#8211; Releasing quarantined emails and attachments</title>
		<link>http://blog.jeshurun.ca/technology/zimbra-recovering-blocked-emails-and-attachments</link>
		<comments>http://blog.jeshurun.ca/technology/zimbra-recovering-blocked-emails-and-attachments#comments</comments>
		<pubDate>Thu, 16 Dec 2010 00:20:06 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[amavisd]]></category>
		<category><![CDATA[blocked attachment]]></category>
		<category><![CDATA[blocked email]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=103</guid>
		<description><![CDATA[If you are reading this post, chances are you administer a Zimbra mail server, and you need to recover an email that was blocked by amavisd for one of your users. This might have happened for a variety of reasons, including your spam score being too high, you have blocks based on file types, or [...]]]></description>
			<content:encoded><![CDATA[<p>If you are reading this post, chances are you administer a Zimbra mail server, and you need to recover an email that was blocked by amavisd for one of your users. This might have happened for a variety of reasons, including your spam score being too high, you have blocks based on file types, or if the email contained an attachment that was encrypted. What you would have quickly found out though, is that there is no quick and easy way of recovering a blocked email and forwarding it on to the intended recipient (at least in the community edition, I&#8217;m not sure of the network edition).</p>
<p>There presently seem to be at least three ways of doing this, and following is the low down on the easiest way I&#8217;ve found so far. If you just need to view the email, please skip to end of this post.</p>
<p><span id="more-103"></span></p>
<p>1. First identify the name the file is quarantined as from the notification email that would have been sent to the admin account. For messages marked as viruses, including emails containing encrypted archives, the line in the email might look something like &#8220;The message has been quarantined as: virus-n89eFiOoPVpn&#8221;. For other blocked emails the name would begin with &#8220;blocked-&#8221; or &#8220;banned-&#8221;.</p>
<p>2. Once you have the name, locate this file on the server. To do this, sudo as zimbra on the server and navigate to &#8220;/opt/zimbra/data/amavisd/quarantine/&#8221;. You should find the file in this folder.</p>
<p>3. Once you have the file name, run the following command:</p>
<pre class="brush: plain; title: ; notranslate">/opt/zimbra/bin/zmlmtpinject -s &amp;lt;sender_email&amp;gt; /opt/zimbra/data/amavisd/quarantine/&amp;lt;file_name&amp;gt; -r &amp;lt;recipient_email&amp;gt;</pre>
<p>Replace:</p>
<pre class="brush: plain; title: ; notranslate">
sender_email with your email or the email you would like the email to be sent as.
recipient_email with the recipient's email address.
file_name with the name of the banned file you identified from step one.
</pre>
<p>4. Done! Following is a list of additional options that are available with zmlmtpinject that you might find handy:</p>
<pre class="brush: plain; title: ; notranslate">
usage: LmtpInject [options] [files]
 where [options] are one of:
 -a,--address            lmtp server (default localhost)
 -d,--directory          message file directory
 -D,--domain             default per-connection recipient domain
 (default example.zimbra.com)
 -N,--every              report progress after every N messages
 (default 100)
 -p,--port               lmtp server port (default 7025)
 -q,--quiet                   don't print per-message status
 -r,--recipient          envelope recipients (rcpt to).  This option
 accepts multiple arguments, so it can't be last if a list of input files
 is used.
 -S,--stopAfter          stop after sending this many messages after
 warm-up
 -s,--sender             envelope sender (mail from)
 -t,--threads            number of worker threads (default 1)
 -T,--trace                   trace server/client traffic
 -u,--username           username prefix (default &amp;quot;user&amp;quot;)
 -w,--warmUpThreshold    warm-up server with first N messages, then
 start measuring (default no warm-up)
 -z,--repeat             repeatedly inject these messages NUM times
 and [files] contain rfc822 messages.  If directory is specified, then
 [files] are ignored.
</pre>
<p>Alternatively, if you just want to view the email, and if you have an email client such as Thunderbird installed on your local computer, you could download the banned-whatever file locally, add a .eml extension to its name and you should be able to open it with your email client.</p>
<p>Credits: Zimbra user forums users ewilen and rsharpe.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/technology/zimbra-recovering-blocked-emails-and-attachments/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rebranding Rogers Xperia X10a for Android 2.1 Update</title>
		<link>http://blog.jeshurun.ca/random-scribblings/re-branding-rogers-xperia-x10a-for-android-2-1-update</link>
		<comments>http://blog.jeshurun.ca/random-scribblings/re-branding-rogers-xperia-x10a-for-android-2-1-update#comments</comments>
		<pubDate>Sun, 14 Nov 2010 20:13:09 +0000</pubDate>
		<dc:creator>jeshurun</dc:creator>
				<category><![CDATA[Random Scribblings]]></category>
		<category><![CDATA[Android 2.1]]></category>
		<category><![CDATA[re-branding]]></category>
		<category><![CDATA[sony ericsson]]></category>
		<category><![CDATA[Xperia X10]]></category>

		<guid isPermaLink="false">http://blog.jeshurun.ca/?p=70</guid>
		<description><![CDATA[Having trouble updating your Xperia X10a to Android 2.1 because you had previously de-branded your phone? This post explains how you can re-brand your phone back to the generic Rogers firmware so you can get the Android 2.1 update right away.]]></description>
			<content:encoded><![CDATA[<p>For those oblivious to the obvious, the Android 2.1 update for the Sony Ericsson Xperia X10 smartphone has finally hit Canada. If you bought the X10 from Rogers and haven&#8217;t debranded it, just connect your phone to the computer via USB and use <a href="http://www.sonyericsson.com/cws/download/1/110/61/1288152720/Update_Service_Setup-2.10.11.10.exe" target="_blank">Sony Ericsson Update Service (SEUS)</a> or Pc Companion for some 2.1 goodness.</p>
<p>This post is for those who are having trouble getting the update, especially those who de-branded the phone to get global updates in the past. Most of this was done with a bug in the SEUS software which allowed a firmware from a different region to be flashed to the phone.</p>
<p>The problem now is that SE have fixed this since then, and re-branding your phone back to Rogers firmware has become somewhat tricky. Re-branding is necessary as presently the generic flash tool for North America isn&#8217;t available yet, and the only way you can get the Android 2.1 update, while still keeping your model as X10a is to get the update from Rogers. I spent half a day trying to figure this out, and I thought I might post my findings here, hoping someone else might find it useful.</p>
<p><span id="more-70"></span>As a word of caution, before you update your phone, please <a href="http://www.sonyericsson.com/cws/support/phones/detailed/downloadthelatestversion/xperiax10?cc=gb&amp;lc=en" target="_blank">backup</a> all your personal information such as contacts and messages. You can use one of several available apps in the market to achieve this.</p>
<p>Disclaimer: Do this at your own risk! While the process is straightforward, there is a risk that you may brick your phone. I hereby absolve myself from any responsibility should you end up bricking your phone by following these steps.</p>
<ol>
<li>You will need the following software installed on your computer:
<ol>
<li>Sony Ericsson Update Service &#8211; Download from <a href="http://www.sonyericsson.com/cws/download/1/110/61/1288152720/Update_Service_Setup-2.10.11.10.exe" target="_blank">here</a></li>
<li>32-bit version of the Java Runtime. It is important to install the 32 bit version even on 64 bit computers, as the flasher has some compatibility issues with the 64 bit version. Next it is necessary to set the &#8220;path&#8221; environment variable to point to the folder where you installed Java. You can find a video of how to do this and the links to the 32 bit JRE downloads <a href="http://www.youtube.com/watch?v=nbVdyoeO9V8" target="_blank">here</a>.</li>
</ol>
</li>
<li>Next, you need to download these two files. One is the flasher tool for overwriting the de-branded firmware on the phone with the default one from Rogers, and the other one is the firmware itself.
<ol>
<li><a href="http://hotfile.com/dl/44983907/9d54b5e/XIOFUB.rar.html" target="_blank">Click to download the Flash tool</a> (credits to original uploader)</li>
<li><a href="http://hotfile.com/dl/43225669/598add6/a_WWE_R1FA014_DEK.zip.html" target="_blank">Click to download the firmware</a> (credits to original uploader)</li>
</ol>
</li>
<li>Extract the file &#8220;XIOFUB&#8221; using a tool such as <a href="http://www.rarlab.com/download.htm" target="_blank">WinRAR</a>. All files will be extracted to a folder named X10Flash_Unbrick</li>
<li>Extract the file &#8221;a_WWE_R1FA014_DEK&#8221; into a different folder and subsequently extract the two files it contains, namely &#8220;android_1233-6929_R11A_R1FA014&#8243; and &#8220;phone&#8221;.</li>
<li>In the folder “android_1233-6929_R11A_R1FA014″
<ol>
<li>Rename: “system_S1-SW-LIVE-AC12-0001-S1-PARTITION-WITH-SPARE.sin” to “system.sin”</li>
<li>Rename: “userdata_S1-SW-LIVE-AC12-0001-S1-PARTITION-WITH-SPARE.sin” to “userdata.sin”</li>
</ol>
</li>
<li>Copy all files in “phone” and “android_1233-6929_R11A_R1FA014″ into the directory of the other file that was downloaded: “XIOFUBX10Flash_Unbrick&#8221;. Overwrite all files located in this directory when prompted.</li>
<li>Now you need to find your device ID. You can only do this if you have connected your phone to the computer and used SEUS atleast once. To find the device id, press start and type &#8220;regedit&#8221;. Click edit&gt;find, and type in “Vid_0fce&amp;Pid_adde”.</li>
<li>The search may take a couple of minutes until the first result. Keep hitting edit-&gt;find next or the F3 key until you find a registry entry key called “DeviceInstance”. Double click the name field and copy the last section of that, it should look something like “5&amp;2888d0ff&amp;0&amp;1″. This is your device ID. Paste this in the file named DeviceID.txt in the X10Flash_Unbrick folder, deleting the existing value, if any.<br />
If the search fails to find anything, make sure “Match whole string” is un-ticked, and click “find next”, if that fails, try “USBVID_0FCE&amp;PID_ADDE”<br />
**Note: It changes with every diffrent USB port you use.</li>
<li>Run X10flash.bat (DONT right click and &#8220;Run as Administrator&#8221;), Connect phone in flash-mode(with phone powered off, hold back key then plug cable in), once the notification light turns on you have 5 seconds to start the flash (press any key) or the phone will continue to boot. The process takes a minute or two to complete(similar to flashing it to 2.1 in the first place if you had used the generic X10i flash tool).</li>
<li>If you get an error such as &#8220;java.io.IOException: Unable to open channel, GetLastError=0         at com.sonyericsson.cs.usbflashnative.impl.USBFlashNativeImpl.openChannel&#8221; then repeat step 9 until you come to the &#8220;DeviceInstance&#8221; key again. Only this time, don&#8217;t copy its value. Instead hit edit-&gt;find next until you find a different key named &#8220;DeviceInstance&#8221; with a different value and paste that into the DeviceID.txt file. You may need to repeat this step until you find a Device ID that works.</li>
<li>Unplug cable and boot phone, it will take a while to boot the first time.</li>
<li>At this point, it is possible that your phone fails to boot and you get a Phone icon with a yellow triangle containing an exclamation mark. Don&#8217;t panic! Just power off the phone and start up SEUS (installed from step one).</li>
<li>Accept the license and click start. Choose the phone as X10 and click next. When it prompts to connect the phone, connect one end of the USB cable to your phone. Press the back button on the phone, and while keeping the button pressed, connect the other end of the cable to the computer. Continue holding the back button until the program prompts you to &#8220;release the back button&#8221;</li>
<li>At this point, a window should pop up, saying a new update is available for the phone, mentioning a list of all the new features, including HD video recording. Start the update process and let it do its thing. Depending on your Internet connection speed, the whole process may take over an hour. If you are using a laptop, make sure its plugged into a power source! Don&#8217;t attempt to disconnect the phone at any point or you may end up bricking it.</li>
<li>Once the update is done, reboot the phone, and your phone should now be running Android 2.1!</li>
</ol>
<p>This method should work for phones flashed with the X10i 2.1 firmware and are having issues with 3G, and should change the baseband back to X10a. Did this method work for you? Did you run into problems? Please leave a comment and let us know.</p>
<p>Have fun with Android 2.1! All credits for the process / tool go to <a href="http://forum.xda-developers.com/" target="_blank">XDA forum</a> members.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.jeshurun.ca/random-scribblings/re-branding-rogers-xperia-x10a-for-android-2-1-update/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>

