<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Of Kings and Cabbage</title>
  <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/" />
  <link rel="self" href="http://blog.opennetcf.com/afeinman/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-10-31T00:37:08.0886806-05:00</updated>
  <author>
    <name>Alex Feinman</name>
  </author>
  <subtitle>Compact Framework Musings. Alex Feinman's web log</subtitle>
  <id>http://blog.opennetcf.com/afeinman/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>Accessing Windows Live Services from Compact .NET Framework applications - Part III, Photos and Storage</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,53972c15-271d-47aa-9461-f7f05200c93c.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,53972c15-271d-47aa-9461-f7f05200c93c.aspx</id>
    <published>2008-10-31T00:37:08.0886806-05:00</published>
    <updated>2008-10-31T00:37:08.0886806-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Calibri" size="3">This is the third post in the series on accessing Live
      Services from Compact .NET Framework applications. So far we have covered </font>
          <a href="http://blog.opennetcf.com/afeinman/PermaLink,guid,80ea4a1d-fbc0-485d-a088-fb8f30efb6ab.aspx">
            <font face="Calibri" size="3">authentication </font>
          </a>
          <font face="Calibri" size="3">and </font>
          <a href="http://blog.opennetcf.com/afeinman/PermaLink,guid,15855efe-824d-4c23-b5d0-b6ff241447cf.aspx">
            <font face="Calibri" size="3">Live
      Contacts</font>
          </a>
          <font face="Calibri" size="3">. The next service we are going to
      discuss is Live Photos. </font>
        </p>
        <p>
          <font face="Calibri" size="3">There are 2 separate APIs available for working with
      Live Photos. One is</font>
          <a href="http://msdn.microsoft.com/en-us/library/cc302759.aspx">
            <font face="Calibri" size="3"> WebDAV-based </font>
          </a>
          <font face="Calibri" size="3">and
      the other is </font>
          <a href="http://msdn.microsoft.com/en-us/library/cc304575.aspx" target="_blank">
            <font face="Calibri" size="3">ATOM
      API</font>
          </a>
          <font face="Calibri" size="3">. While both can be used successfully
      to upload photos, create albums etc, WebDAV is generally considered to be deprecated
      in favor of more modern SOAP APIs such as </font>
          <a href="http://tools.ietf.org/html/rfc5023">
            <font face="Calibri" size="3">ATOM
      Publishing Protocol</font>
          </a>
          <font face="Calibri" size="3">.</font>
        </p>
        <p>
          <font face="Calibri" size="3">Photo ATOM documentation tells us that the format of
      the ATOM request for Photo access is as follows:</font>
        </p>
        <p>
          <font face="Calibri" size="3">[METHOD] /[path to resource] HTTP/1.1 
      <br />
      Host: cumulus.services.live.com 
      <br />
      User-Agent: [Name of the user agent, typically the client app or service.] 
      <br />
      Authentication: DelegatedToken dt="[delegation token]"</font>
        </p>
        <p>
          <font face="Calibri" size="3">We are going to use it with one modification. Instead
      of <em>Authentication: DelegatedToken dt="[delegation token]"</em> we will
      add <em>Authorization: WLID1.0 t="[auth token]"</em>.</font>
        </p>
        <p>
          <font face="Calibri" size="3">Similar to what we have done previously, the [path to
      resource] part is constructed as /[live ID]/[Service]/[Path to item] where [live ID]
      is the WLID of the current account (e.g. </font>
          <a href="mailto:someone@live.com">
            <font face="Calibri" size="3">someone@live.com</font>
          </a>
          <font face="Calibri" size="3">),
      [service] is AtomSpacesPhotos and [Path to item] is a combination of Album and Photo
      identifier. And example of a folder URL: 
      <br /></font>
          <a href="https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders(231">
            <font face="Calibri" size="3">https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders(231</font>
          </a>
          <font face="Calibri" size="3">)</font>
        </p>
        <p>
          <font face="Calibri" size="3">An example of a photo URL: 
      <br /></font>
          <a href="https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders(196)/Photos(200)/$value">
            <font face="Calibri" size="3">https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders(196)/Photos(200)/$value</font>
          </a>
          <font face="Calibri" size="3">
            <br />
      This one has content type image/jpeg. It returns image binary stream in jpeg format.
      An HTTP POST to the above url with the request body set to the image binary stream
      and content type set to image/jpeg will update the image.</font>
        </p>
        <p>
          <font face="Calibri" size="3">To retrieve a list of all top-level folders use </font>
          <a href="https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders">
            <font face="Calibri" size="3">https://cumulus.services.live.com/someone@live.com/AtomSpacesPhotos/Folders</font>
          </a>
          <font face="Calibri" size="3">.</font>
        </p>
        <p>
          <font face="Calibri" size="3">[this is work in progress. to be continued. code samples
      coming shortly]</font>
        </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=53972c15-271d-47aa-9461-f7f05200c93c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Accessing Windows Live Services from Compact .NET Framework applications - Part II, Contacts</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,15855efe-824d-4c23-b5d0-b6ff241447cf.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,15855efe-824d-4c23-b5d0-b6ff241447cf.aspx</id>
    <published>2008-10-29T12:41:37.6410000-05:00</published>
    <updated>2008-10-29T12:57:14.4338746-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Now that we know how to acquire authentication ticket from Windows Live, we can put
      it to work accessing the user's contact list. In general a number of requests to the
      Live Services follow a common pattern. It is an HTTP(s) request to <font color="#a31515" size="2"><font color="#a31515" size="2"><a href="https://cumulus.services.live.com/{user identity}/{Service}/">https://cumulus.services.live.com/{user
      identity}/{Service}/</a></font></font></p>
        <p>
          <font color="#a31515" size="2">
            <font color="#a31515" size="2">Depending on the operation
      the request could be GET, PUT, DELETE, POST or other. User identity is the email address
      that is the Windows Live ID. Service can be one of the supported services. E.g. for
      contacts it is <em>LiveContacts</em>.</font>
          </font>
        </p>
        <p>
          <font color="#a31515" size="2">
            <font color="#a31515" size="2">In order to provide
      the authentication ticket to the server the caller needs to include a custom HTTP
      header - "Authorization" and set its value to WLID1.0 t="{base64 auth ticket}" where
      {base64 auth ticket} is <a href="http://blog.opennetcf.com/afeinman/PermaLink,guid,80ea4a1d-fbc0-485d-a088-fb8f30efb6ab.aspx">the
      ticket retrieved from the authentication server</a>.</font>
          </font>
        </p>
        <font color="#a31515" size="2">
          <font color="#a31515" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> url <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"https://cumulus.services.live.com/{0}/LiveContacts/"</span>;<br />
      url <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Format(url,
      userID);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> result <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> SendHttpRequest(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ref</span> url, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>.Format(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"WLID1.0
      t=\"{0}\""</span>,ticket), <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"GET"</span>,
      System.Net.HttpStatusCode.OK, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span>);<br />
      XmlDocument docContacts <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> XmlDocument();<br />
      docContacts.LoadXml(result);</span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <font face="Verdana" size="2">The
      code above will retrieve the entire contact list as described <a href="http://msdn.microsoft.com/en-us/library/bb463933.aspx">here</a>.</font>
              </span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <font face="Verdana" size="2">In
      order to create a contact, a POST to <a href="https://cumulus.services.live.com/{user identity}/LiveContacts/">https://cumulus.services.live.com/{user
      identity}/LiveContacts/</a>Contacts is required. The post contents should be an xml
      message formatted in accordance with Live contacts schema and having appropriate fields
      filled in. It is wort mentioning that WindowsLiveID field is not just an email address.
      It has to be a valid Live ID. Another thing to keep in mind is that almost any content-related
      error will cause HTTP code 403 (supposedly, for security reasons).</font>
              </span>
            </p>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <font face="Verdana" size="2">To
      delete a contact a DELETE verb is used. In order to indetify the contact being deleted
      or updated the application should use contact GUID provided in the ID tag:</font>
              </span>
            </p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <font color="#0000ff">
                <font color="#0000ff">
                  <p>
                    <font size="2">&lt;</font>
                  </p>
                </font>
              </font>
              <font color="#a31515">
                <font color="#a31515" size="2">Contact</font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
      &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">ID</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>
                <font color="#0000ff">
                  <strong>ead5572c-9c61-43a2-b71f-f2412e283598</strong>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&lt;/</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">ID</font>
                </font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
      &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">AutoUpdateEnabled</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>false<font color="#0000ff"><font color="#0000ff">&lt;/</font></font><font color="#a31515"><font color="#a31515">AutoUpdateEnabled</font></font></font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
      &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">LastChanged</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>2007-11-19T20:26:57.2230000Z<font color="#0000ff"><font color="#0000ff">&lt;/</font></font><font color="#a31515"><font color="#a31515">LastChanged</font></font></font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
      &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Profiles</font>
                </font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
         &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Personal</font>
                </font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
            &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">FirstName</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>Alex<font color="#0000ff"><font color="#0000ff">&lt;/</font></font><font color="#a31515"><font color="#a31515">FirstName</font></font></font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
            &lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">LastName</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>Feinman<font color="#0000ff"><font color="#0000ff">&lt;/</font></font><font color="#a31515"><font color="#a31515">LastName</font></font></font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
            </font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&lt;</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Gender</font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&gt;</font>
                </font>Male<font color="#0000ff"><font color="#0000ff">&lt;/</font></font><font color="#a31515"><font color="#a31515">Gender</font></font></font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
         </font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&lt;/</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Personal</font>
                </font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br />
      &lt;/</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Profiles</font>
                </font>
              </font>
              <font size="2">
                <font color="#0000ff">
                  <font color="#0000ff">&gt;<br /></font>
                </font>
                <font color="#0000ff">
                  <font color="#0000ff">&lt;/</font>
                </font>
                <font color="#a31515">
                  <font color="#a31515">Contact</font>
                </font>
              </font>
              <font color="#0000ff">
                <font color="#0000ff">
                  <font size="2">&gt;</font>
                  <p>
                    <font face="Verdana" color="#000000" size="2">The post url will look like this:</font>
                  </p>
                  <font face="Verdana" color="#000000">
                  </font>
                  <font color="#a31515">
                    <font color="#a31515">
                      <p>
                        <a href="https://cumulus.services.live.com/someone@example.com/LiveContacts/contacts/Contact(ead5572c-9c61-43a2-b71f-f2412e283598">
                          <font size="2">https://cumulus.services.live.com/someone@example.com/LiveContacts/contacts/Contact(<strong><font color="#0000ff">ead5572c-9c61-43a2-b71f-f2412e283598
      </font></strong></font>
                        </a>
                      </p>
                    </font>)</font>
                  <p>
                  </p>
                </font>
              </font>
            </span>
          </font>
        </font>
        <font face="Verdana" size="2">Same url format is using for updates.
   Keep in mind that to update data you need to use PUT verb.</font>
        <br />
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=15855efe-824d-4c23-b5d0-b6ff241447cf" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Accessing Windows Live Services from Compact .NET Framework applications - Part I, Authentication</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,80ea4a1d-fbc0-485d-a088-fb8f30efb6ab.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,80ea4a1d-fbc0-485d-a088-fb8f30efb6ab.aspx</id>
    <published>2008-10-29T11:13:32.9690000-05:00</published>
    <updated>2008-10-29T11:17:22.8358358-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="html">&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Windows
   Live Services is an infrastructure (I am trying to avoid words like 'ecosystem') that
   provides multiple services (contacts, photo albums, blogs, web storage, mail etc)
   available via federated authentication mechanism. While the majority of these services
   are exposed to the user as web pages, they are also available to regular applications.
   Microsoft own such as LIve Mail, Live Writer, Live Gallery as well as 3rd party via&amp;nbsp; &lt;a href="http://msdn.microsoft.com/en-us/library/bb264574.aspx"&gt;&lt;font color=#0000ff&gt;Live
   Services SDK&lt;/font&gt;&lt;/a&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;.
   I am going to provide a short&amp;nbsp;introduction on accessing some of the Live Services
   programmatically from Compact .NET Framework applications.&lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;The
   starting point of any Live Services interaction being authenticating the user, it
   is only natural that Microsoft has provided a .&lt;a href="http://msdn.microsoft.com/en-us/library/bb404791.aspx"&gt;NET
   component that handles the authentication for applications&lt;/a&gt;. This component however
   is offered only for desktop applications. Nevertheless behind every Live Service interaction
   there is a web request of a sort, which suggests that it can be emulated using NETCF
   code. While there are several authentication options available in Windows Live, there
   is just one that is really suitable for smart clients - RPS (Relying Party Suites).
   Underneath it is simply an HTTP POST of some XML data over secure channel. Upon successful
   request the application receives an encoded authentication ticket valid typically
   for 24 hours (the exact expiration time is provided with the ticket). To request the
   ticket an application sends XML message to &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;a href="https://dev.login.live.com/wstlogin.srf"&gt;&lt;font color=#0000ff&gt;https://dev.login.live.com/wstlogin.srf&lt;/font&gt;&lt;/a&gt;.
   The message uses content type "application/soap+xml" and looks like this:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Envelope&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:s&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://www.w3.org/2003/05/soap-envelope&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wsse&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:saml&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;urn:oasis:names:tc:SAML:1.0:assertion&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&amp;nbsp;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wsp&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.xmlsoap.org/ws/2004/09/policy&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wsu&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wsa&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://www.w3.org/2005/08/addressing&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wssc&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.xmlsoap.org/ws/2005/02/sc&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wst&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.xmlsoap.org/ws/2005/02/trust&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Header&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wlid:ClientInfo&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;xmlns:wlid&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;http://schemas.microsoft.com/wlid&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wlid:ApplicationID&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;10&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wlid:ApplicationID&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wlid:ClientInfo&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:Action&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;s:mustUnderstand&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;1&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:Action&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:To&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;s:mustUnderstand&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;1&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;https://dev.login.live.com/wstlogin.srf&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:To&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Security&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:UsernameToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;wsu:Id&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;user&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Username&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;example@live.com&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Username&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Password&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;S3cr3t&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Password&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:UsernameToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsse:Security&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Header&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:RequestSecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Id&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;RST0&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:RequestType&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/Issue&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:RequestType&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsp:AppliesTo&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:EndpointReference&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:Address&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;http://live.com&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:Address&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsa:EndpointReference&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsp:AppliesTo&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsp:PolicyReference&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;URI&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; = &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;MBI&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsp:PolicyReference&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:RequestSecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;s:Envelope&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Naturally,
   in the above XML the wsse:Username and wsse:Password will have to be substituted with
   actual user-provided credentials. In response we expect a standard SOAP message that
   has action set to &lt;a href="http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue"&gt;&lt;font color=#0000ff&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue&lt;/font&gt;&lt;/a&gt;.
   In the body of this message of particular interest are the following parts:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:Lifetime&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsu:Created&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;2008-10-29T14:38:23Z&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsu:Created&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsu:Expires&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;2008-10-29T22:38:23Z&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wsu:Expires&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;br&gt;
   &amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;wst:Lifetime&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;and &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;wst:RequestedSecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;wsse:BinarySecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Id&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Compact0&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;t=[very
   long Base64-encoded string here]&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;wsse:BinarySecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;gt;&lt;br&gt;
   &amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Verdana','sans-serif'"&gt;wst:RequestedSecurityToken&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;The
   former tells us the ticket validity time range. There is no need to reacquire a ticket
   until Expires date. The latter contains the actual ticket. Notice that while it has
   a format &lt;em&gt;&lt;span style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;t=IKnvriu73nf...&lt;/span&gt;&lt;/em&gt;,
   the actual requests sent later to the Live servers will require the Base64 part to
   be quoted like this: &lt;em&gt;&lt;span style="FONT-FAMILY: 'Verdana','sans-serif'"&gt;t="IKnvriu73nf..."&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Of
   course the application should be prepared to deal with authentication failures. A
   logon failure (bad password) will result in a message that looks like this:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp; &amp;lt;S:Body&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Fault&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Code&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Value&amp;gt;S:Sender&amp;lt;/S:Value&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Subcode&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Value&amp;gt;wst:FailedAuthentication&amp;lt;/S:Value&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/S:Subcode&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/S:Code&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Reason&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Text xml:lang="en-US"&amp;gt;Authentication
   Failure&amp;lt;/S:Text&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/S:Reason&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;S:Detail&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;psf:error&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;psf:value&amp;gt;0x80048821&amp;lt;/psf:value&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;psf:internalerror&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;psf:code&amp;gt;0x80041012&amp;lt;/psf:code&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;psf:text&amp;gt;The
   entered and stored passwords do not match.&amp;lt;/psf:text&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/psf:internalerror&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/psf:error&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/S:Detail&amp;gt;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/S:Fault&amp;gt;&lt;br&gt;
   &amp;nbsp; &amp;lt;/S:Body&amp;gt;&lt;br&gt;
   &amp;lt;/S:Envelope&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Notice
   that it conveniently includes human-readable failure reason as well as a hex error
   code.&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;font color=#000000&gt;The
   code&amp;nbsp;to request the ticket would look like this (sans error handling):&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; AcquireTicket(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; userName, &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; password)&lt;br&gt;
   {&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; url &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;@"https://dev.login.live.com/wstlogin.srf"&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;HttpWebRequest request &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; WebRequest.Create(url)&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;as&lt;/span&gt; HttpWebRequest
   ;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;request.Method &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"POST"&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;request.ContentType &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"application/soap+xml;
   charset=UTF-8"&lt;/span&gt;;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;request.Timeout &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; 10 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;*&lt;/span&gt; 1000; &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   Wait for at most 10 seconds&lt;/span&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;byte&lt;/span&gt;[]
   bytes &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; System.Text.Encoding.UTF8.GetBytes(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt;.Format(
   soapEnvelope, userName, password));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;request.ContentLength &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; bytes.Length;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;Stream reqStream &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; request.GetRequestStream();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;reqStream.Write(bytes, 0, bytes.Length);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;reqStream.Close();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;WebResponse response;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;response &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; request.GetResponse();&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;string&lt;/span&gt; xml;&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;using&lt;/span&gt; (System.IO.StreamReader
   reader &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; System.IO.StreamReader(response.GetResponseStream()))&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xml &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; reader.ReadToEnd();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;response.Close();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;XmlDocument document &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; XmlDocument();&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;document.LoadXml(xml);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;XmlNamespaceManager nsManager &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; XmlNamespaceManager(document.NameTable);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;nsManager.AddNamespace(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"wsse"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&lt;/span&gt;);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;XmlNode node &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; document.SelectSingleNode(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;@"//wsse:BinarySecurityToken/text()"&lt;/span&gt;,
   nsManager);&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (node
   == &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)&lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;; &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
   The wsse:BinarySecurityToken element is missing. Examine the xml for error information&lt;/span&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;/span&gt;
   &lt;br&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; node.Value;&lt;br&gt;
   }&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;o:p&gt;&lt;/o:p&gt;
   &gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
   &lt;o:p&gt;
      &lt;font face=Calibri color=#000000 size=3&gt;To&amp;nbsp;be continued:&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=80ea4a1d-fbc0-485d-a088-fb8f30efb6ab" /&gt;</content>
  </entry>
  <entry>
    <title>Russian science in trouble</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,bec1694f-766b-4d85-9bf3-02e63582c4b3.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,bec1694f-766b-4d85-9bf3-02e63582c4b3.aspx</id>
    <published>2008-02-28T05:22:35.7100000-06:00</published>
    <updated>2008-02-28T08:03:10.7633371-06:00</updated>
    <category term="Life" label="Life" scheme="dasBlog" />
    <category term="Rant" label="Rant" scheme="dasBlog" />
    <category term="Science" label="Science" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It is sometimes said that the reason Soviet Union has produced so many outstanding
      scientists is that a lot of attention was being paid to introducing kids to science
      early and in a way that kept them interested. Indeed, a large amount of popular science
      books has been printed over the years as well as translations made of the best ones
      offered in the rest of the world. Martin Gardner and Richard Feinman, absolutely fascinating
      Robert Wood biography, Smullyan, Soviet authors Perelman and Makovetsky - all of those
      made me fall in love with physics, mathematics, mechanics, chemistry as a kid. And
      of course these books were fairly accurate as they were either authored or reviewed
      by respected professionals.
   </p>
        <p>
      Times change and these days people find that you cannot blindly trust books you buy.
      Quite recently a <a href="http://community.livejournal.com/astronomy_ru/96772.html">very
      lively discussion </a>took place in one of the LiveJournal communities (very popular
      in Russia). It was about a book recently printed in Moscow called "Unabridged
      Encyclopedia of Astronomy". The book that contains 25000 articles, has many entries
      that make even a casual student of science do a doubletake (some of it could be explained
      by the fact that the entire author team somehow did not have a single specialist in
      astronomy or even general physics among them). 
   </p>
        <p>
      Here are some gems (translated from original Russian as closely as possible)
   </p>
        <p>
      "<strong>Gravitational waves</strong> - are emitted by electrical charge oscillating
      in space"
   </p>
        <p>
      "<strong>Barnard star</strong> - a <em>stationary</em> star with visual magnitude
      of 9.5m... Known for being <em>fast-moving</em>..."
   </p>
        <p>
      "<strong>Visible radiation</strong> - radiation that is not only visible to the naked
      eye, but to the special astronomical equipment and devices..."
   </p>
        <p>
      "<strong>Visible light</strong> - light being radiated by a heated body..."
   </p>
        <p>
      "<strong>Escape velocity</strong> - [is] defined as speed required for a man-made
      satellite to reach the Earth orbit. Equals 12km/s"
   </p>
        <p>
      "<strong>Galactic Cannibalism</strong> (Extragalactic Astronomy) - a part of Astronomy
      dealing with celestial bodies (stars, galaxies, quasars etc) that exist outside our
      Galaxy"
   </p>
        <p>
      "<strong>Ultraviolet radiation</strong> - radiation emitted by the Sun and stars"
   </p>
        <p>
      "<strong>Interference </strong>- wave oscillation produced by the light source generates
      so called spherical wave fronts"
   </p>
        <p>
      "<strong>Polar Star</strong> - the main star <u>L</u> of Ursa Minor constellation
      and the brightest star of the northern hemisphere"
   </p>
        <p>
      "<strong>Rigel</strong> - the brightest star in the constellation of Orion and in
      the entire sky"
   </p>
        <p>
      "<strong>Lynx</strong> - one of the constellations of the southern hemisphere"
   </p>
        <p>
      "<strong>Triton</strong> - a constellation discovered by Lassell in 1846. It's mass
      is calculated at 2.14x10^22 kg" 
   </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <em>The next one is tricky. It makes no sense at all in Russian, so be prepared for
      the same in English translation.</em>
          </p>
        </blockquote>
        <p>
      "<strong>Phase angle</strong> - an angle situated at a distance from the Sun to the
      Moon as well as from the Moon to the Earth"
   </p>
        <p>
      "<strong>Fundamental Astronomy</strong> - modern physical-mathematical discipline
      growing interdependent with advances in science and technology"
   </p>
        <p>
      Fortunately, some astute readers (one of them employed by Moscow planetarium - must
      know her astronomy, eh?) were able to spot it and raise some ruckus. As they were
      not able to get any response from the publisher, someone suggested to make a formal
      complaint to the russian authorities, invoking Consumer Protection Act. We'll see
      how it goes.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=bec1694f-766b-4d85-9bf3-02e63582c4b3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,5291cae4-c5d8-4333-a5d7-d4a57646e7e5.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,5291cae4-c5d8-4333-a5d7-d4a57646e7e5.aspx</id>
    <published>2008-02-26T08:46:07.8940000-06:00</published>
    <updated>2008-02-26T08:46:36.4568750-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele">Raffaele Rialdi </a>pointed out that
      attempting to run RTF Host from Compact Framework 3.5 Power Toys on an emulator produces
      the following error:
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused because the default CoreCon transport on the
      emulator is DMA (DeviceDMA.dll). Here are the steps to add emulator as a manual Tcp
      connection. Not that many will need it, but it is useful for a demo
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br />
      2. Configure Network and Storage card folder<br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=5291cae4-c5d8-4333-a5d7-d4a57646e7e5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>PowerDVD Ultra - first experiences</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,ad573686-ebbb-477a-8086-9a9ef7c893a4.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,ad573686-ebbb-477a-8086-9a9ef7c893a4.aspx</id>
    <published>2007-12-29T18:17:35.0995000-06:00</published>
    <updated>2007-12-29T18:17:35.0995000-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Cyberlink was kind enough to let me evaluate the latest version of their PowerDVD
      Ultra product - about a year ago. Yet I procrastinated. Now, a year later I found
      myself in posession of a <a href="http://www.dell.com/content/products/productdetails.aspx/xpsdt_420?c=us&amp;cs=19&amp;l=en&amp;s=dhs&amp;~tab=bundlestab">brand-new
      Media Center machine </a>(does the phrase "Dude, you are getting a Dell" sound familiar?), which
      is connected to a brand new <a href="http://www.samsung.com/us/consumer/detail/detail.do?group=televisions&amp;type=televisions&amp;subtype=lcdtv&amp;model_cd=LNT5271FX/XAA">1080P
      Samsung LCD TV</a>. I've slightly upgraded it with an LG GGC-H20L Blu-Ray/HD-DVD Reader and
      realized, how close I to being finally able to watch HD DVDs on a Media Center machine
      (instead of Xbox 360). This is where I remembered about Cyberlink generous offer. 
   </p>
        <p>
      After a painless 100MB download (you can buy all of the Cyberlink products electronically,
      directly on their web site, and depending on the speed of your connection, you will
      get to install it in 5-10 min), I ran the setup and was shortly rewarded with the
      activation dialog. I am not big fan of software activation (Windows or any other),
      but as far as the activation experiences go, this one was seamless and easy.
   </p>
        <p>
      PowerDVD comes with a companion application called BluRay Advisor (there is also nearly
      identical HD DVD Advisor). This application checks your system for being ready to
      play HD content. The last time I ran it a year ago, I got a message saying that my
      display card was underpowered, my CPU - barely sufficient (P IV 3.6GHz) and my TV
      entirely unsuitable due to the lack of HDCP support. This time I had a green light
      on every item, except the video driver - the Advisor did not recognize the driver
      version and indicated the status as unknown.
   </p>
        <p>
      My TV uses so called 10' setup, meaning that normally there is no keyboard or mouse
      connected to it (well, there is a Media Center keyboard, just in case, but I
      rarely use it). Earlier versions of PowerDVD did not fare well with the Media Center
      remote, but the current one does not seem to have any problems. I was able to control
      it perfectly well, except of going into settings and such. For day-to-day needs, such
      as watching DVD MCE Remote gives you all control you need.
   </p>
        <p>
      PowerDVD fully supports HD DVD menu system. My experience with it did not differ from
      Xbox 360 one.
   </p>
        <p>
      There are few minor annoyances - nothing critical, but I have to mention them:<br />
       - when starting playback, Vista pops a message saying that the application is
      not compatible with Windows Aero and that Windows will switch into basic mode.<br />
       - I was not able to figure out how to select the disk to play. The machine has
      a regular DVD drive, an HD DVD drive and a DVD changer. By default the player picks
      the first of them. I'm sure there is a setting somewhere, but I wish it were
      more accessible. As it is I have to open Computer window and select the disc I want
      to play<br />
      - The status overlay that's shown in the upper right corner when you are controlling
      volume, is way too small. From the couch it is nearly impossible to read.
   </p>
        <p>
      I want to emphasize, that the above list is of really minor issues. The application
      is very good in every way and does the job of playing DVDs and HD DVDs nearly perfectly.
      The picture quality is superb, there are no artifacts or playback delays, missed frames
      and other unpleasant occurences that might mire your viewing experience.
   </p>
        <p>
      In conclusion I wanted to mention the auto update feature. It is not something new
      - Microsoft, Adobe, Intel and quite a few others have it. Nevertheless it is gratifying
      to know that you don't have to check the web site for updates constantly (and who
      doesn't love updates) - it's done for you.
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=ad573686-ebbb-477a-8086-9a9ef7c893a4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part III)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f.aspx</id>
    <published>2007-12-26T03:50:12.4580000-06:00</published>
    <updated>2007-12-26T04:07:39.7866250-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      This one has been actually gleaned through a usenet post, but needs a wider coverage
   </p>
        <h5>Trying to use dwAlphaConst member of DDOVERLAYFX structure to specify
      overall overlay transparency results in E_INVALIDARG error
   </h5>
        <p>
          <font size="2">As explained <a href="http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/8263cc28238a4092/1fb494361d758ec7">here</a>,
      there is a clever bug in the parameter checking logic that results in the API soundly
      rejecting any combination of dwAlphaConst and dwAlphaConstBitDepth, unless dwAlphaConst
      == 1 &lt;&lt; dwAlphaConstBitDepth. This is not fixed as of WM 6 AKU4. Interestingly
      enough the actual value of dwAlphaConstBitDepth seems to be ... ignored, once the
      parameter check is done. The bit depth used is always 8 bit.</font>
        </p>
        <ul>
          <li>
            <font size="2">The net result of this bug is that the allowed values for the dwAlphaConstBitDepth/dwAlphaConst
         and the resulting opacity are<br />
         1/2 - 0.78%<br />
         2/4 - 1.6%<br />
         3/8 - 3.1%<br />
         4/16 - 6.2%<br />
         5/32 - 12.5%<br />
         6/64 - 25%<br />
         7/128 - 50%</font>
          </li>
        </ul>
        <p>
      Not using DDOVER_ALPHACONSTOVERRIDE gives you of course 100% (opaque overlay). In
      my experience anything under 5 (12.5%) is too small to be useful, but YMMV. Here
      is the code snippet:
   </p>
        <font size="2">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      fUseAlpha )<br />
      {<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      dwAlpha &gt; 8 ) <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
      Bug in ddraw</span><br />
              dwAlpha <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 8;<br />
          <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
      dwAlpha &lt; 8 )<br />
          {<br />
              dwUpdateFlags |= DDOVER_ALPHACONSTOVERRIDE;<br />
              ovfx.dwAlphaConst <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 1
      &lt;&lt; dwAlpha;<br />
              ovfx.dwAlphaConstBitDepth <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> dwAlpha;<br />
          }<br />
      }</span>
          </p>
        </font>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=e6d0cf14-6264-4b77-9c96-d2ebdd09fd6f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part I|)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,018a8ea8-6d78-45ae-ba96-143caab7c842.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,018a8ea8-6d78-45ae-ba96-143caab7c842.aspx</id>
    <published>2007-12-26T03:25:03.6147500-06:00</published>
    <updated>2007-12-26T03:25:03.6147500-06:00</updated>
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <h5>Call to IDirectDrawSurface::Blt returns E_INVALIDARG
   </h5>
        <p>
      While possible causes for this error are numerous, I wanted to point out a specific
      one that is not mentioned anywhere: either source or destination rectangle is
      empty ( zero width or height )
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=018a8ea8-6d78-45ae-ba96-143caab7c842" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DirectDraw experiences (Part I)</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,d1fb6baf-46d5-4c0d-a069-47615c41da9b.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,d1fb6baf-46d5-4c0d-a069-47615c41da9b.aspx</id>
    <published>2007-12-26T03:20:39.8803750-06:00</published>
    <updated>2007-12-26T03:20:39.8803750-06:00</updated>
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It's been a while. Things were a bit hectic. Nevertheless I am back.
   </p>
        <p>
      These days I am working on a rather interesting project involving DirectDraw on Windows
      Mobile 6. Without going into the project details, I wanted to share some experiences.
      So far, a number of time I would run into an issue, and of course not it would not
      be explained/documented/covered anywhere where the Google search takes you. It struck
      me that I must be not the first one to hit these issues, and if I list them here,
      chances are that Google search will be more productive for the next poor sod to plow
      through underdocumented (to put it mildly), convoluted (again, to put it mildly) and
      unforgiving API such as DirectDraw. I am going to have multiple posts with keywords
      facilitating search. If a month from now you will find out that I produced all of
      one post (this one seems to be on track so far. Chances for it not making it are slim),
      don't judge me too hard. I am away from home for the 3rd week in a row, having missed
      Christmas, but should be back for the New Year. Ok, here goes.
   </p>
        <p>
          <hr />
        </p>
        <h5>Call to IDirectDrawSurface::Blt returns DDERR_SURFACEBUSY
   </h5>
        <p>
      The documentation says to check for other threads accessing your surface at the same
      time. The group search suggests to search for mismatching Lock/Unlock calls. The actual
      cause turned to be a missed call to IDirectDrawSurface::ReleaseDC (after a successfull
      call to IDirectDrawSurface::GetDC). If you think about it, internally these calls
      must be using Lock/Unlock, so cudos to Group search and boo to MSDN documentation
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=d1fb6baf-46d5-4c0d-a069-47615c41da9b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WISPLite on Windows Mobile 6</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,e6309045-3f60-4ec4-835f-34a7a98c3ab5.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,e6309045-3f60-4ec4-835f-34a7a98c3ab5.aspx</id>
    <published>2007-06-01T16:20:22.8450000-05:00</published>
    <updated>2007-06-01T16:26:29.8926250-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I was quite surprised to learn that apparently I have missed an important new feature
      of Windows Mobile 6 (Professional)- <a href="http://msdn2.microsoft.com/en-us/library/bb431764.aspx">inking
      and ink serialization support</a>. Gone are the days when a developer had to tinker
      with oh-so-temperamental InkX control. Now everyone and his brother can take advantage
      not only of high-quality precision ink support with smoothing and serialization, but
      also of handwriting recognition built into Windows Mobile 6 Professional. To quote
      the documentation - <em>"It provides a rich inking experience, through high quality
      curve–fitted ink with anti-aliasing, transparent ink, and highlighter ink. It provides
      an API for Ink collection, data management, rendering, and recognition. It also provides
      Ink controls to support the note–taking scenario."</em></p>
        <p>
      Another important feature is interoperability and serialized data format compatibility
      with ink support on Tablet PC.
   </p>
        <p>
      While all of this is nice, there is slight bit of bad news - using this rich set of
      goodies requires C++. There are 2 ways to use ink in Windows Mobile 6 - InkCanvas
      control and an COM automation library. <a href="http://msdn2.microsoft.com/en-us/library/bb431715.aspx">InkCanvas
      control </a>offers the ability to use a regular Win32 control (similar to InkX)
      to write, highlight, collect ink etc via <a href="http://msdn2.microsoft.com/en-us/library/bb160710.aspx">a
      set of Windows messages</a>. <a href="http://msdn2.microsoft.com/en-us/library/bb431732.aspx">COM
      automation library </a>on the other hand allows accessing the entire set of features
      offered by WISP. And there is no managed wrapper for the time being.
   </p>
        <p>
      As a public service, we at <a href="http://www.OpenNETCF.com">OpenNETCF.com</a> are
      proud to offer <a href="http://www.opennetcf.com/downloads/download.aspx?s=OpenNETCF.WindowsMobile.Ink">WISPLite
      managed wrapper</a>. The wrapper offers the entire WISPLite functionality (although
      not every method of every interface has been tested). There is InkControl class, which
      wraps InkCanvas, and a OpenNETCF.WindowsMobile.Ink namespace that contains imported
      COM interfaces. Some of the interfaces do not wrap cleanly, so a bit of coding is
      needed.
   </p>
        <p>
      Here is what the demo app looks like (warning, before running it, change line 132
      in Form1.cs to be
   </p>
        <font size="2">
          <p>
      inkControl1.SetPenStyle((
   </p>
        </font>
        <font color="#0000ff" size="2">float</font>
        <font size="2">)trackBar1.Value,
   penColor, penType); )</font>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/InkDemo.png" border="0" />
        </p>
        <p>
      Saving ink data to a file:
   </p>
        <font size="2">
          <p>
          </p>
        </font>
        <font color="#0000ff" size="2">using</font>
        <font size="2"> (</font>
        <font color="#2b91af" size="2">SaveFileDialog</font>
        <font size="2"> fd
   = </font>
        <font color="#0000ff" size="2">new</font>
        <font size="2">
        </font>
        <font color="#2b91af" size="2">SaveFileDialog</font>
        <font size="2">())<br />
   {<br />
     fd.Filter = </font>
        <font color="#a31515" size="2">"Ink files (*.isf)|*.isf|All
   files (*.*)|*.*"</font>
        <font size="2">;<br />
     </font>
        <font color="#0000ff" size="2">if</font>
        <font size="2"> (fd.ShowDialog()
   == </font>
        <font color="#2b91af" size="2">DialogResult</font>
        <font size="2">.OK)<br />
     {<br />
       </font>
        <font color="#0000ff" size="2">byte</font>
        <font size="2">[]
   data = (</font>
        <font color="#0000ff" size="2">byte</font>
        <font size="2">[])inkControl1.GetInkData(</font>
        <font color="#2b91af" size="2">IC_INKENCODING</font>
        <font size="2">.BINARY);<br /></font>
        <font color="#2b91af" size="2">
          <font color="#003300">    </font>FileStream</font>
        <font size="2"> stm
   = </font>
        <font color="#2b91af" size="2">File</font>
        <font size="2">.OpenWrite(fd.FileName);<br />
       stm.Write(data, 0, data.Length);<br />
       stm.Close();<br />
     }<br />
   }</font>
        <p>
          <font size="2">Getting ink as bitmap and retrieving recongnition result:</font>
        </p>
        <font size="2">
          <p>
      pbPreview.Image = inkControl1.GetInkDataAsBitmap();<br />
      lblReco.Text = inkControl1.RecognizedText;
   </p>
        </font>
        <p>
          <font size="2">In conclusion I'd like to ask to report problems with this wrapper
      to this blog's comments. 
      </font>
        </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=e6309045-3f60-4ec4-835f-34a7a98c3ab5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Enabling CoreCon logging in NETCFv2</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,6c113acf-7ec2-4328-a154-16c29a4737ce.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,6c113acf-7ec2-4328-a154-16c29a4737ce.aspx</id>
    <published>2007-04-17T14:12:44.6752500-05:00</published>
    <updated>2007-04-17T14:12:44.6752500-05:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Sometimes when trying to connect Visual Studio t a device, especially to a custom
      CE platform, it is helpful to see if there are any problems reported by the CoreCon
      components on the device side. CoreCon components (ConmanClient, trasnport DLLs, edbgtl.dll
      and edm.exe) all have an integrated logging facility, which can be used by a developer
      for troubleshooting.
   </p>
        <p>
      To enable Corecon debug log you can set the following under HKLM\Software\Microsoft\VSD\Logging
   </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
            <font face="Courier New">VSD_LogEnabled: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToDebugger: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToConsole: DWORD: 1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogToFile: DWORD:1,0</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogLevel: DWORD - set to at least 4, up to 9</font>
          </p>
          <p>
            <font face="Courier New">VSD_LogFile: REG_SZ (default VSDLogFile.txt)</font>
          </p>
        </blockquote>
        <p>
      Keep in mind that the ConMan log can be quite chatty, so enable it sparingly and only
      when needed
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=6c113acf-7ec2-4328-a154-16c29a4737ce" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Using RAPI to provision devices from the desktop</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,bdea60e3-69db-4971-ab3a-ff5e293bcaee.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,bdea60e3-69db-4971-ab3a-ff5e293bcaee.aspx</id>
    <published>2007-04-13T19:43:46.9720000-05:00</published>
    <updated>2007-04-13T19:57:22.0190000-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      XML-based device configuration is a powerful mechanism of configuring Windows
      Mobile 2003 and newer devices. There are four ways to provision your device with new
      settings:
   </p>
        <ol>
          <li>
         Call <a href="http://msdn2.microsoft.com/en-us/library/ms852998.aspx">DMProcessConfigXML </a>on
         device. It can be done from <a href="http://windowsmobilepro.blogspot.com/2006/02/how-to-programmatically-query-mail.html">native</a> or <a href="http://www.smartphonethoughts.com/articles.php?action=expand,4397">managed</a> code. 
      </li>
          <li>
            <a href="http://blogs.msdn.com/windowsmobile/archive/2006/01/28/making_a_root_cert_cab_file.aspx">Build
         a CAB file containing _setup.xml </a>with provisioning XML and run it on the device 
      </li>
          <li>
         Send the xml configuration via WAP push 
      </li>
          <li>
         Use <a href="http://msdn2.microsoft.com/en-us/library/aa454232.aspx">RapiConfig </a>tool
         shipped with WIndows Mobile SDK (under Tools)</li>
        </ol>
        <p>
      But what if you wanted to perform configuration from your own, PC-based installer?
      Granted, you could use method 2 and copy the cab over to the device, then invoke wceload
      etc. Or you could write your own RAPI dll and use CeRapiInvoke. Or perhaps even launch
      RapiConfig to do this for you. Fortunately there is an easier way. As one could suspect,
      RapiConfig does not use a complex approach. Rather it benefits from an undocumented
      but handy RAPI call that is the desktop version of DMProcessConfigXML. It is exported
      by ordinal (25) and has the same signature as DMProcessConfigXML. Unlike DMProcessConfigXML,
      the pointer returned by it in the 3rd parameter needs to be freed using CeRapiFreeBuffer.
   </p>
        <p>
          <font face="Courier New">#pragma comment(lib, "rapi")</font>
        </p>
        <p>
          <font face="Courier New">STDAPI CeRapiInit();<br />
      STDAPI CeRapiUninit();<br />
      STDAPI CeRapiFreeBuffer(LPVOID);<br />
      typedef HRESULT (__stdcall *CeProcessConfigType)(LPCWSTR pszConfig, DWORD dwFlags,
      LPCWSTR* ppszConfigOut);</font>
        </p>
        <p>
          <font face="Courier New">int _tmain(int argc, _TCHAR* argv[])<br />
      {<br />
       if ( argc != 3 )<br />
       {<br />
        _tprintf(_T("Usage: rapiconfig &lt;config file&gt; &lt;out file&gt;\n"));<br />
        return 1;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> CeRapiInit();<br />
       <br />
       CeProcessConfigType CeProcessConfig = 
      <br />
         (CeProcessConfigType)GetProcAddress(GetModuleHandle(_T("rapi.dll")),
      (LPCSTR)25);</font>
        </p>
        <p>
          <font face="Courier New"> HANDLE hFile = CreateFile(argv[1], GENERIC_READ, FILE_SHARE_READ,
      NULL, OPEN_EXISTING, 0, NULL);<br />
       if ( hFile == INVALID_HANDLE_VALUE )<br />
       {<br />
        _tprintf(_T("Unable to open %s\n"), argv[1]);<br />
        goto Exit;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> DWORD cbConfig = GetFileSize(hFile, NULL);<br />
       BYTE* pBuffer = new BYTE[cbConfig];<br />
       if ( !pBuffer )<br />
        goto Exit;</font>
        </p>
        <p>
          <font face="Courier New"> ReadFile(hFile, pBuffer, cbConfig, &amp;cbConfig, NULL);<br />
       <br />
       LPCWSTR pOut;<br />
       LPWSTR pIn;<br />
       pIn = new WCHAR[cbConfig + 1];<br />
       ZeroMemory(pIn, (cbConfig+1) * 2);<br />
       mbstowcs(pIn, (LPCSTR)pBuffer, cbConfig);<br />
       HRESULT hr;<br />
       if ( FAILED(hr = CeProcessConfig(pIn, 1, &amp;pOut) ))<br />
       {<br />
        _tprintf(_T("Unable to process: %d\n"), hr);<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> HANDLE hFileOut = CreateFile(argv[2], GENERIC_WRITE,
      0, NULL, CREATE_ALWAYS, 0, NULL);<br />
       if ( hFileOut == INVALID_HANDLE_VALUE )<br />
       {<br />
        _tprintf(_T("Unable to create %s\n"), argv[2]);<br />
        goto Exit;<br />
       }</font>
        </p>
        <p>
          <font face="Courier New"> WriteFile(hFileOut, pOut, (wcslen(pOut) + 1 )* 2, &amp;cbConfig,
      NULL);</font>
        </p>
        <p>
          <font face="Courier New"> CloseHandle(hFileOut);<br />
       CeRapiFreeBuffer((LPVOID)pOut);</font>
        </p>
        <p>
          <font face="Courier New">Exit:<br />
       if ( hFile != INVALID_HANDLE_VALUE )<br />
        CloseHandle(hFile);</font>
        </p>
        <p>
          <font face="Courier New"> CeRapiUninit();<br />
       return 0;<br />
      }<br /></font>
        </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=bdea60e3-69db-4971-ab3a-ff5e293bcaee" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,ac6cd193-d63c-4644-bf9a-7dd6f0b30c76.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,ac6cd193-d63c-4644-bf9a-7dd6f0b30c76.aspx</id>
    <published>2007-02-25T08:45:36.6440000-06:00</published>
    <updated>2008-02-26T08:45:36.6443750-06:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Code" label="Code" scheme="dasBlog" />
    <category term="Computers" label="Computers" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele ">Raffaele Rialdi </a>pointed out that
      attempting to run RTF Host from Compact Framework 3.5 Power Toys on an emulator produces
      the following error:
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused because the default CoreCon transport on the
      emulator is DMA (DeviceDMA.dll). Here are the steps to add emulator as a manual Tcp
      connection. Not that many will need it, but it is useful for a demo
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br />
      2. Configure Network and Storage card folder<br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=ac6cd193-d63c-4644-bf9a-7dd6f0b30c76" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Running RTF Host (Compact Framework 3.5 Power Toys) on emulator</title>
    <link rel="alternate" type="text/html" href="http://blog.opennetcf.com/afeinman/PermaLink,guid,fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc.aspx" />
    <id>http://blog.opennetcf.com/afeinman/PermaLink,guid,fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc.aspx</id>
    <published>2007-02-25T06:55:18.9250000-06:00</published>
    <updated>2008-02-25T06:55:18.9256250-06:00</updated>
    <category term=".Net technology" label=".Net technology" scheme="dasBlog" />
    <category term="Microsoft" label="Microsoft" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.ugidotnet.org/raffaele">Raffaele Rialdi</a> has pointed
      out that trying to run RTF Host from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8174c14-a27d-4148-bf01-86c2e0953eab&amp;DisplayLang=en">CF
      3.5 Power Toys </a>(required for manual connectivity) on a Windows Mobile emulator
      produces an error :
   </p>
        <p>
          <img src="http://blog.opennetcf.org/afeinman/content/binary/RTFError.png" border="0" />
        </p>
        <p>
      This is caused by RTF getting confused and trying to use DMA transport instead of
      TCP. Here are the steps to establish a manual RTF connection to an emulator (you don't
      really need it unless you are doing a demo)
   </p>
        <p>
      1. Start Emulator using Device Emulator Manager.<br /><br />
      2. Configure Network and Storage card folder<br /><br />
      3. Copy to storage card folder the following file: "C:\Program Files\Common 
      <br />
      Files\microsoft shared\CoreCon\1.0\Target\wce400\armv4i\TCPConnectionA.dll"<br /><br />
      4. In File ExplorerNavigate to \Windows\Corecon1.1. If you don't see it 
      <br />
      there, connect to the emulator from Studio<br /><br />
      5. Launch ClientShutdown (you should see a guid-named folder to appear)<br /><br />
      6. Copy \Storage Card\TcpConnectionA.dll to \Windows<br /><br />
      7. Go to \Windows and delete DeviceDMA.dll (if you can't, you forgot to 
      <br />
      launch ClientShutdown)<br /><br />
      8. Go back to \Windows\Corecon1.1 and launch ConmanClient.exe<br /><br />
      9. Launch RTF Host. Enjoy<br /></p>
        <img width="0" height="0" src="http://blog.opennetcf.com/afeinman/aggbug.ashx?id=fb3cfd88-2d46-4aa8-a89a-8df02b10b6bc" />
      </div>
    </content>
  </entry>
</feed>