<?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>Senthil Rajasekharan&#039;s Personal Blog - Meeting of Minds &#187; C#</title>
	<atom:link href="http://blog.rajasekharan.com/category/programming/c-sharp-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajasekharan.com</link>
	<description>And this too shall pass...</description>
	<lastBuildDate>Mon, 19 Dec 2011 02:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Building a JSON Axis2 REST Client for a WCF Service.</title>
		<link>http://blog.rajasekharan.com/2010/10/19/building-a-json-axis2-rest-client-wcf-service/</link>
		<comments>http://blog.rajasekharan.com/2010/10/19/building-a-json-axis2-rest-client-wcf-service/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 20:00:26 +0000</pubDate>
		<dc:creator>senthil</dc:creator>
				<category><![CDATA[Axis2]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.rajasekharan.com/?p=242</guid>
		<description><![CDATA[Using JSON as the message format for a WCF REST service has some advantages if you are building a backend service for a purely browser based application. For instance, JSON is natively supported in all of the major web browsers. I had to build a REST client using Axis2 that uses the JSON message format. [...]]]></description>
			<content:encoded><![CDATA[<p>Using JSON as the message format for a WCF REST service has some advantages<br />
if you are building a backend service for a purely browser based application.</p>
<p>For instance, JSON is natively supported in all of the major web browsers.</p>
<p>I had to build a REST client using Axis2 that uses the JSON message format.</p>
<p>The blog post <a href="http://www.keith-chapman.org/2008/09/enabling-json-in-apache-axis2.html"> Enabling JSON in Apache Axis2</a> explains the conventions that are used to map XML to JSON and how to configure axis2.xml so that your client application can use the XML/JSON mapping convention of your choice.</p>
<p>I chose the mapped namespace convention which can be configured by adding the two lines to your axis2.xml</p>
<p>&lt;messageFormatter contentType=&quot;application/json&quot;<br />
                 class=&quot;org.apache.axis2.json.JSONMessageFormatter&quot;/&gt;  </p>
<p>&lt;messageBuilder contentType=&quot;application/json&quot;<br />
                 class=&quot;org.apache.axis2.json.JSONOMBuilder&quot;/&gt;</p>
<p>If you choose the mapped namespace convention you may get an exception that says &#8220;JSON mapped namespaces are not supported in Axis2&#8243;. If you see the above Axis2 exception then you need to patch jettison.</p>
<p>Instructions on the exception and the patch are in the <a href="http://www.marcusschiesser.de/?p=130">&#8220;Building a JSON web service with Java and Axis2&#8243;</a> post by <a href="http://www.marcusschiesser.de">Marcus Schiesser</a>.</p>
<p>The ServiceClient (org.apache.axis2.client.ServiceClient) object can be used to make REST API calls in Axis2.</p>
<p>The ServiceClient can be configured using the Options (org.apache.axis2.client.Options) object.</p>
<p>For a REST style service invocation you need the following options,</p>
<p><code><br />
Options options = new Options();<br />
options.setTo(new EndpointReference("http://your.service.endpoint.url"));<br />
options.setProperty(Configuration.MESSAGE_TYPE, "application/json");<br />
options.setProperty(Configuration.ENABLE_REST, Constants.VALUE_TRUE);</p>
<p>//reuse HTTP clients<br />
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);<br />
options.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);</code></p>
<p>The httpClient object is created via the MultiThreadedHttpConnectionManager. This is needed for managing the HTTP connections if your client is used in a multithreaded application. See the post <a href="http://amilachinthaka.blogspot.com/2009/05/improving-axis2-client-http-transport.html">&#8220;Improving Axis2 Client HTTP  Transport Performance&#8221;</a></p>
<p>Finally, you have to engage the addressing module and set the ServiceClient options</p>
<p><code><br />
client = new ServiceClient();<br />
client.engageModule("addressing");<br />
client.setOptions(options);<br />
</code></p>
<p>The ServiceClient sendReceive call takes an OMElement which I created using custom XML serialization on the message objects.</p>
<p>Make sure you cleanup the http connections via the httpconnectionManager used to create the httpClient. Again. see the post <a href="http://amilachinthaka.blogspot.com/2009/05/improving-axis2-client-http-transport.html">&#8220;Improving Axis2 Client HTTP  Transport Performance&#8221;</a> on how to do this correctly.</p>
<p>The sendReceive call can be made non-blocking if you are looking for further improvements in performance.</p>
<p>The response returned by the sendReceive call is an OMElement again and can be de-serialized using custom XML de-serialization on your message objects.</p>
<p>If you are looking for pure SOAP interoperability between WCF .NET SOAP client and an Axis2 service be sure to chek out my other post <a href="http://blog.rajasekharan.com/2010/09/20/axis2-and-wcf-dotnet-interop/">Axis2 and WCF .Net Interoperability (Interop)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rajasekharan.com/2010/10/19/building-a-json-axis2-rest-client-wcf-service/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TarTool &#8211; Windows tar gzip tgz extraction tool</title>
		<link>http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/</link>
		<comments>http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 00:59:34 +0000</pubDate>
		<dc:creator>senthil</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[tar extract tool]]></category>
		<category><![CDATA[TarTool]]></category>
		<category><![CDATA[tgz]]></category>
		<category><![CDATA[windows 2008]]></category>

		<guid isPermaLink="false">http://blog.rajasekharan.com/?p=112</guid>
		<description><![CDATA[TarTool is a tiny windows command line tool to extract tar gzip (tar.gz or tgz extension) files. You can download TarTool , unzip and run TarTool.exe as a command line executable. You can also download TarTool from this alternate download location if the link above is down or does not work for you. The source [...]]]></description>
			<content:encoded><![CDATA[<p><a title="TarTool.zip" href="http://dev.rajasekharan.com/TarTool/" target="_blank">TarTool </a>is a tiny windows command line tool to extract tar gzip (tar.gz or tgz extension) files.</p>
<p>You can <a title="TarTool" href="http://tartool.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=31505" target="_blank"><strong>download</strong> </a>TarTool , unzip and run TarTool.exe as a command line executable.</p>
<p>You can also <a title="TarTool - Alternate download location." href="http://dev.rajasekharan.com/TarTool/" target="_blank">download </a>TarTool from this alternate download location if the link above is down or does not work for you.</p>
<p>The <a title="TarTool Source Code" href="http://tartool.codeplex.com" target="_blank">source code </a> for TarTool is now hosted on <a title="TarTool Source Code " href="http://tartool.codeplex.com" target="_blank">codeplex</a>.</p>
<p>I wanted to play around with the Microsoft Shared Source CLI <a title="Microsoft Shared Source CLI" href="http://en.wikipedia.org/wiki/Shared_Source_Common_Language_Infrastructure" target="_blank">SSCLI</a>. The <a title="Shared Source Common Language Infrastructure 2.0 Release" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&amp;displaylang=en" target="_blank">download </a>is only available as a tgz extension. Imagine that <img src='http://blog.rajasekharan.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>After searching the interwebs for tools that would extract tar gzip files , I was disappointed since there was no simple tool to extract tar gzip files on my windows machine.</p>
<p>There are a few tools out there like WinRAR etc., but I found them too bloated for my task.</p>
<p>So I wrote a little tool using <a title="SharpZipLib" href="http://www.icsharpcode.net/OpenSource/SharpZipLib/" target="_blank">SharpZipLib</a>, the open source Zip, GZip, Tar and BZip2 library (great job guys, BTW).</p>
<p><a title="SharpZipLib" href="http://www.icsharpcode.net/OpenSource/SharpZipLib/" target="_blank">SharpZipLib</a> does most of the heavy lifting so the core of <a title="TarTool.zip" href="http://dev.rajasekharan.com/TarTool/" target="_blank">TarTool </a> is less than ten lines of C#. <span style="text-decoration: line-through">I can host the source code if there is enough interest.</span></p>
<p>The <a title="TarTool Source Code" href="http://tartool.codeplex.com/" target="_blank">source </a>is now hosted on codeplex.</p>
<p>Enjoy!</p>
<p> <strong>Update (05/06/2009 17:00 CST) :</strong></p>
<p>TarTool now has an addtional option to untar tar file formats.</p>
<p>TarTool -x sample.tar temp</p>
<p>will untar the sample.tar contents into the temp folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.239 seconds -->

