<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Karthik Gopalakrishnan</title>
        <link>http://karthikg.net/blog/Default.aspx</link>
        <description>nimble wits</description>
        <language>en-US</language>
        <copyright>Karthik Gopalakrishnan</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <image>
            <title>Karthik Gopalakrishnan</title>
            <url>http://karthikg.net/blog/images/RSS2Image.gif</url>
            <link>http://karthikg.net/blog/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title> WCF  - WS Security - Java</title>
            <category>.NET Framework </category>
            <category>WCF</category>
            <category>C#</category>
            <link>http://karthikg.net/blog/archive/2009/10/22/22.aspx</link>
            <description>&lt;p&gt;I wanted  to consume  a  java webservice, so I wrote a WCF client to consume the service. I thought Java -.Net  interinteroperability would be easy with WCF, not so easy.  &lt;/p&gt;
&lt;p&gt;The Java Web Service used WS-Security and required a UserNameToken passed as clear text.  The below code snippet  from Hanselman's blog will solve the problem, but there is a catch . This will work only if the endpoint address is on SSL. Ofcourse, WCF will not allow you to pass UserNameToken ( username &amp;amp; password) as clear text on http. It has to passed on https protocol, only then it will work . &lt;/p&gt;
&lt;p&gt;             &lt;br /&gt;
&lt;/p&gt;
&lt;div class="dropshadow code"&gt;
&lt;div class="innerbox"&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WCFMethod()
{

    WSHttpBinding myBinding = &lt;span class="kwrd"&gt;new&lt;/span&gt; WSHttpBinding();
    myBinding.Security.Mode 
        = SecurityMode.TransportWithMessageCredential;
    myBinding.Security.Message
    .ClientCredentialType = MessageCredentialType.UserName;
    myBinding.Security
    .Message.EstablishSecurityContext = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

    myBinding.Security
    .Message.NegotiateServiceCredential = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

    BindingElementCollection elements = myBinding.CreateBindingElements();
    elements
    .Find&amp;lt;SecurityBindingElement&amp;gt;().IncludeTimestamp = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

    elements
    .Find&amp;lt;TextMessageEncodingBindingElement&amp;gt;()
    .MessageVersion = MessageVersion.Soap11;
    CustomBinding newBinding = &lt;span class="kwrd"&gt;new&lt;/span&gt; CustomBinding(elements);
    FooPortTypeClient svc = 
    &lt;span class="kwrd"&gt;new&lt;/span&gt; FooPortTypeClient(newBinding, 
    &lt;span class="kwrd"&gt;new&lt;/span&gt; EndpointAddress(&lt;span class="str"&gt;"https://javawebservice.com/service"&lt;/span&gt;));
}&lt;/pre&gt;
&lt;pre class="csharpcode"&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="dropShadowText"&gt; &lt;/div&gt;
&lt;p&gt; So, I had to go apply SSL on the webservice, to get this done. I digged more &amp;amp; was wondering if I could create a custom binding by getting my hands dirty. It turned out, there is already an open source custom binding, luckily I stumbled on  &lt;a href="http://webservices20.blogspot.com/2008/11/introducing-wcf-clearusernamebinding.html"&gt;Yaron Naveh&lt;/a&gt;'s  blog. He has writtern Clear Username Binding to solve the problem and is  hosted on&lt;a target="_blank" href="http://code.google.com/p/wcf-clear-username-binding/"&gt;google code&lt;/a&gt;.  I hope this helps others like me. I used this binding get authenticated on http using WS-Security. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://karthikg.net/blog/aggbug/22.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Karthik Gopalakrishnan</dc:creator>
            <guid>http://karthikg.net/blog/archive/2009/10/22/22.aspx</guid>
            <pubDate>Thu, 22 Oct 2009 23:16:55 GMT</pubDate>
            <wfw:comment>http://karthikg.net/blog/comments/22.aspx</wfw:comment>
            <comments>http://karthikg.net/blog/archive/2009/10/22/22.aspx#feedback</comments>
            <wfw:commentRss>http://karthikg.net/blog/comments/commentRss/22.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Ascii control Characters  not XML Serialiazible</title>
            <category>.NET Framework </category>
            <link>http://karthikg.net/blog/archive/2009/10/21/21.aspx</link>
            <description>&lt;p&gt;I don't know  if people are aware of the below exception. I wanted to throw some light on the issue, and help stranded people solve this issue. &lt;br /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Exception information: &lt;/span&gt;&lt;br style="FONT-WEIGHT: bold" /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Exception type: ArgumentException &lt;/span&gt;&lt;br style="FONT-WEIGHT: bold" /&gt;
&lt;span style="FONT-WEIGHT: bold"&gt;Exception message: '', hexadecimal value 0x01, is an invalid character.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I support a web service which is heavily being used in the company, users who were consuming the web service where reporting problems that it was throwing some exception like above. After lot of investigation I solved the issue with  &lt;a href="http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character"&gt;Bill's blog&lt;/a&gt;&lt;br /&gt;
Ascii control characters are not allowed in XML, they don't conform to xml specification.  So The .net framework when trying to serialize information with ascii control characters into XML , it throws an exception. These characters should not be allowed. &lt;br /&gt;
&lt;br /&gt;
There are two ways to clean up the data and to remove the characters, you have to search the string , here is how you can do it. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class="dropshadow code"&gt;
&lt;div class="innerbox"&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span class="rem"&gt;/// Remove illegal XML characters from a string.&lt;/span&gt;
&lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SanitizeXmlString(&lt;span class="kwrd"&gt;string&lt;/span&gt; xml)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (xml == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;"xml"&lt;/span&gt;);
    }

    StringBuilder buffer = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder(xml.Length);

    &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;char&lt;/span&gt; c &lt;span class="kwrd"&gt;in&lt;/span&gt; xml)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (IsLegalXmlChar(c))
        {
            buffer.Append(c);
        }
    }

    &lt;span class="kwrd"&gt;return&lt;/span&gt; buffer.ToString();
}&lt;/pre&gt;
&lt;pre class="csharpcode"&gt; &lt;/pre&gt;
&lt;pre&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="dropShadowText"&gt;
&lt;p&gt;source : &lt;a href="http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character"&gt;Bill's blog&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here is my version of the code using regex. &lt;/p&gt;
&lt;/div&gt;
&lt;div class="dropshadow code"&gt;
&lt;div class="innerbox"&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt; 
&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SanitizeXmlString(&lt;span class="kwrd"&gt;string&lt;/span&gt; xml)
{
 
   &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(xml))
   {
     &lt;span class="kwrd"&gt;char&lt;/span&gt;[] hexp = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;char&lt;/span&gt;[7] 
     { &lt;span class="str"&gt;'\x00'&lt;/span&gt;, &lt;span class="str"&gt;'\x08'&lt;/span&gt;, &lt;span class="str"&gt;'\x10'&lt;/span&gt;, &lt;span class="str"&gt;'\x19'&lt;/span&gt;, 
       &lt;span class="str"&gt;'\x0B'&lt;/span&gt;, &lt;span class="str"&gt;'\x0F'&lt;/span&gt;, &lt;span class="str"&gt;'\x7F'&lt;/span&gt; };
     &lt;span class="kwrd"&gt;string&lt;/span&gt; pattern = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
     pattern = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"[{0}-{1}{2}-{3}{4}-{5}{6}]"&lt;/span&gt;, 
     hexp[0], hexp[1], hexp[2], 
     hexp[3], hexp[4], hexp[5], hexp[6]);
     xml = Regex.Replace(xml, pattern, &lt;span class="str"&gt;""&lt;/span&gt;);
    }
   
    &lt;span class="kwrd"&gt;return&lt;/span&gt; xml;  
}

&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://karthikg.net/blog/aggbug/21.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Karthik Gopalakrishnan</dc:creator>
            <guid>http://karthikg.net/blog/archive/2009/10/21/21.aspx</guid>
            <pubDate>Wed, 21 Oct 2009 23:42:55 GMT</pubDate>
            <wfw:comment>http://karthikg.net/blog/comments/21.aspx</wfw:comment>
            <comments>http://karthikg.net/blog/archive/2009/10/21/21.aspx#feedback</comments>
            <wfw:commentRss>http://karthikg.net/blog/comments/commentRss/21.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Career 2.0 -Take Control of your life</title>
            <category>Career Development</category>
            <category>Book Review</category>
            <link>http://karthikg.net/blog/archive/2009/07/06/20.aspx</link>
            <description>&lt;img style="MARGIN-RIGHT: 10px" height="100" alt="" width="100" align="left" src="/blog/images/karthikg_net/blog/career_2.0.jpg" /&gt; 
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Book Review : Career 2.0 take control of your life&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I stumbled across some &lt;a href="http://www.suryasuravarapu.com/2009/02/book-review-career-20.html"&gt;blog&lt;/a&gt; via &lt;a href="http://twitter.com/karthikg"&gt;twitter&lt;/a&gt; and read an article about the book.  I had never heard of &lt;a href="http://www.jaredrichardson.net/"&gt;Jared Richardson&lt;/a&gt; before. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I watched career 2.0 video recorded at the Minnesota  code camp. I decided to buy the book and read it. &lt;/font&gt;&lt;font face="Arial"&gt;Career 2.0  book delivers what it promises. The book was in the market at the right time for developers. &lt;/font&gt;&lt;font face="Arial"&gt;The book targets technical people, clearly motivates you to learn, talk and emphasis and shows you should invest in your career.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Notes from the book :&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;"You're not a victim of anyone but yourself"&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;    The book first explains why is it that you should invest in your career. It brings out some good examples from the telecom bust. &lt;/font&gt;&lt;font face="Arial"&gt;The technology has a shelf-life of a banana, New languages and frameworks are spawning out each day. Start learning the technology of the year (LOTY) or a new language each year. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The author refers to  the "&lt;a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1246910015&amp;amp;sr=8-1"&gt;Pragmatic Programmer&lt;/a&gt;" about learning a new language each year.  He compares learning new language to running or picking up a new or old sport that you never played or left playing a  long time. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Goals&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;strong&gt;"Mt Everest and you".&lt;/strong&gt; &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This book lays out options and strategies on how to go about making the start. Plan, prepare and climb. We spend most of your awake hours at work. How can we prioritize, learn and achieve our goals. The author explains the &lt;a href="http://en.wikipedia.org/wiki/Maslow's_hierarchy_of_needs"&gt;Maslow's Pyramid&lt;/a&gt; ( hierarchy of needs) with 5 levels, when you should focus on creativity and growth, definitely not when you don't have a job. Climb the pyramid to acheive your goals. The author keeps his language really simple , easy to read and it helps assimilate the wealth of the book immediately. &lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Share &amp;amp; learn:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;  "Your knowledge grows as you give ".  &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Start a &lt;a href="http://blogger.com"&gt;blog&lt;/a&gt;, document what you learn each day. Read a book and review it in your blog. This would help the learning process also improve your writing skills, if it sucked badly like mine. &lt;/p&gt;
&lt;p&gt;Present a topic that you learnt at a users group, workplace or a code camp. Jared puts these different ideas with anecdotes, which shows the benefits really well. &lt;/p&gt;
&lt;p&gt;With the power of Search Engines, your blog could help someone in some country. Write a page everyday, about something, that would improve your writing. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Verdict:&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;The book is a must buy for all technical folks who would want to grow and climb the ladder. This book is a real motivator, when can you say that ? when you immediately get of your couch and do what the book says. &lt;br /&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;img src="http://karthikg.net/blog/aggbug/20.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Karthik Gopalakrishnan</dc:creator>
            <guid>http://karthikg.net/blog/archive/2009/07/06/20.aspx</guid>
            <pubDate>Mon, 06 Jul 2009 19:29:50 GMT</pubDate>
            <wfw:comment>http://karthikg.net/blog/comments/20.aspx</wfw:comment>
            <comments>http://karthikg.net/blog/archive/2009/07/06/20.aspx#feedback</comments>
            <wfw:commentRss>http://karthikg.net/blog/comments/commentRss/20.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How I became a Programmer</title>
            <category>Personal</category>
            <category>Fun</category>
            <link>http://karthikg.net/blog/archive/2009/06/03/17.aspx</link>
            <description>&lt;p&gt;There is an interesting tale behind this, I first saw a computer in the early 1990's at my school. My youger sister was learning &lt;a href="http://en.wikipedia.org/wiki/LOGO"&gt;LOGO&lt;/a&gt; at school. I took her book and read through in summer. The next year I started learning &lt;a href="http://en.wikipedia.org/wiki/BASICA"&gt;Basica&lt;/a&gt; at school in my 8th grade. My fascination grow when i saw somebody play Prince of Persia game on a 486 PC. I went onto study Computer Science in College . I started learning algorithms and programmed in &lt;a href="http://en.wikipedia.org/wiki/FORTRAN"&gt;FORTRAN 77 &lt;/a&gt;and &lt;a href="http://en.wikipedia.org/wiki/Pascal"&gt;PASCAL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I still remember my programming assignment which exposed me to a different language called &lt;a href="http://en.wikipedia.org/wiki/Scheme_language"&gt;Scheme&lt;/a&gt;. I could see the power of recursion in action. We had to convert a 600 line c code to scheme. The scheme code turned out to be only 100 lines. I learnt Visual basic 6.0 in college, which taught my how to build data driven application. This helped land ino my first real job which was developing a contact management system in Visual Basic 6 and MS Access. From there I went on learning web programming and developed applications in classic ASP and moved to .NET.&lt;/p&gt;&lt;img src="http://karthikg.net/blog/aggbug/17.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Karthik Gopalakrishnan</dc:creator>
            <guid>http://karthikg.net/blog/archive/2009/06/03/17.aspx</guid>
            <pubDate>Wed, 03 Jun 2009 23:52:19 GMT</pubDate>
            <wfw:comment>http://karthikg.net/blog/comments/17.aspx</wfw:comment>
            <comments>http://karthikg.net/blog/archive/2009/06/03/17.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://karthikg.net/blog/comments/commentRss/17.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Review on Sleepless in L.A</title>
            <link>http://karthikg.net/blog/archive/2008/02/08/review-on-sleepless-in-l.a.aspx</link>
            <description>&lt;p&gt;Its been 2 weeks after the InfusionDev Sleepless in L.A  event. It's time to talk about it.  I really enjoyed the all night coding challenge on sharepoint. There were just two people from Northern California for the event. I was suprised to know from &lt;a href="http://home.infusionblogs.com/kguenther/default.aspx"&gt;Kurt&lt;/a&gt; that only 4 people were registered for the event.  I liked all the presentations of Kurt and Shawn. I wish they gave some training. I was expecting to gain some insight on Business Data catalog (BDC). It was there on Kurt's slides and he never had time to talk about it.  &lt;/p&gt;
&lt;p&gt;The evening was fun, the event was sponsored by Microsoft. We had a ride on a Limo ( partied like a rock star).   I was in a team of two. We were short of one person. We decided to get something implemented soon and hit the bed. So Paras and I  wrote a Photo Slide show Web part using Flicker.Net Api from &lt;a href="http://codeplex.com"&gt;Codeplex&lt;/a&gt;. The idea was to contribute something to &lt;a href="http://www.codeplex.com/CKS"&gt;community kit for sharepoint&lt;/a&gt; in codeplex.  We had an arguement whether to try silverlight with sharepoint or not.  We did not win. The judges were looking for some sharepoint features like list, document library. Unfortunately, we did not leverage it. Kesav's Team won the prize. They deserved it for their idea and implementation.  &lt;/p&gt;
&lt;p&gt;Here are some pictures from the event. &lt;/p&gt;
&lt;p&gt;such a big hummer Limo. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.karthikg.net/blog/images/karthikg_net/blog/sleeplessfrommark004.jpg"&gt;&lt;img height="200" alt="Big Hummer" width="300" src="/blog/images/karthikg_net/blog/sleepless004_small.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="1"&gt;source: &lt;/font&gt;&lt;a href="http://www.infusionblogs.com/sleepless"&gt;&lt;font size="1"&gt;infusion sleeless&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I should be hiding somewhere in the back on the right side. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.karthikg.net/blog/images/karthikg_net/blog/sleeplessfrommark003.jpg"&gt;&lt;img height="200" alt="with the Crew" width="300" src="/blog/images/karthikg_net/blog/sleepless003_small.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;font size="1"&gt;source: &lt;/font&gt;&lt;a href="http://www.infusionblogs.com/sleepless"&gt;&lt;font size="1"&gt;infusion sleeless&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://karthikg.net/blog/aggbug/14.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Karthik Gopalakrishnan</dc:creator>
            <guid>http://karthikg.net/blog/archive/2008/02/08/review-on-sleepless-in-l.a.aspx</guid>
            <pubDate>Sat, 09 Feb 2008 01:43:32 GMT</pubDate>
            <wfw:comment>http://karthikg.net/blog/comments/14.aspx</wfw:comment>
            <comments>http://karthikg.net/blog/archive/2008/02/08/review-on-sleepless-in-l.a.aspx#feedback</comments>
            <wfw:commentRss>http://karthikg.net/blog/comments/commentRss/14.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>