December 2005 - Posts

ASP.NET Podcast Show #32 – Reflections of 2005 & Using a DataTable in “Atlas”
Saturday, December 31, 2005 3:32 PM

The real final show for 2005. Wally recaps on some of the highlights,

Check out the post as it was meant to be viewed, on the The ASP.NET Podcast Site.

Subscribe or simply Download

 

Wally doesn't let me get the last word in.

 

Wow, I didn't know if we would make it this far and what kind of form we would have ended up in.  I wanted to take some time to go thru and look at some of the really cool events of 2005.

January

  • Got my ASP.NET MVP reawarded.
  • Charlotte to do a talk.  Scott Forsyth and Orcsweb.
  • What does it take to do webcasting?
  • School Board.  Wanted to build a new school in our area and threatened us with condemnation.
  • ADO.NET book continued forward.
  • Contract and negotiations.

February

  • .NET CTP.
  • More with the school board.  Cooler heads finally prevail.
  • ADO.NET book continues forward.  Final large chapter is in.
  • Project work in DC starts back up.

March

  • Chattanooga to do a talk.
  • Project work in DC ramps up some more.
  • ADO.NET book changes.

April

  • Birmingham to do a talk.
  • Jason Salas and the Digital Pontification.
    • Sir Wally.
    •  ASP.NET Podcast.  (Me, Paul, Buddy, Jason, Robert McLaws).
  • Final chapter is in.
  • Get a new co-author.
  • .NET 2.0 beta2 and Sql 2k5 with the updated ADO.NET InProc Provider changes.
  • What is this AJAX thing?

May

  • I do my first podcast and yes, the motorcycle will be here forever.
  • DC codecamp.
  • My first codecamp. Atlanta.
  • My first SDR @ MS.
  • Sir Wally wins the Database Geek of the Week award. 

June

  • First round of edits for the ADO.NET book.
  • ScottGu – Atlas – WTF is AJAX?
  • Paul starts in on the podcast.
  • June CTP of Sql Server 2k5.

July

  • More podcasts.  Hey, you have to do something in the hotel room.
  • Shot 71 in golf.  WTF?
  • Sang the GT fight song on DP.
  • Edits on the ADO.NET book.
  • Went to the IIS7 devlab.
    •  Probably embarrassed myself a ton.
    • Questions.
    • Lunch with Shanku and Rich – more questions on Atlas.
  • Wrote my first http handler.
  • Go approval for an AJAX with ASP.NET book.

August

  • More podcasts.  Hey, you have to do something in the hotel room.
  • Work continued in DC.

September

  • Final edits for the ADO.NET book.
  • First Atlas downloads.
  • Podcasting continued.

October

  • ADO.NET Book is out of our hands.
  • ASPInsider Summit.
    • Spang.
    • Atlas.
    • Enjoyed the whole experience with everyone.
  • Writing started on the AJAX with ASP.NET book.
  • Turned in some chapters even.
  • Alabama Codecamp.

November

  • Nov 7, 2005 – VS.NET and Sql2k5 ship.
  • Aspnetpodcast.com site is up, thanks to Scott Forsyth and Orcsweb.
  • New Atlas build.
  • User Group talk on Atlas.
  • Ready to go with an application.  ($500k vs. $86k)
  • Turned in a chapter on AJAX. (XML).

December

  • New Atlas build.
  • Holidays.
  • Kids basketball.
  • Chapter writing continues on Atlas.

People that I have met or remet along the way.

MS people.

  • Rich Ersek.
  • Scott Guthrie.
  • Shanku Niyogi.
  • Nikhil Kothari.
  • Pablo Castro.

Wilco Bauwer.

David Yack.

Ambrose Little.

Plipper.

Bill Ryan.

Jason Salas.

ASPInsiders.

  • Rob Chartier.
  • Chris Frazier.
  • Jason Gaylord.

Craig Shoemaker.

 

Frappr Map.  Goto the podcast site and get in on the fun.

Send me your pictures for the listener gallery.

 

Iterating through a DataTable in Atlas.

get_length()

getItem(i) for the rows.

getProperty(“Column Name”) for the column.

        function MethodReturn(result)

        {

            var i = 0;

            var str = "";

            var strRowsInfo = "";

            var strReturn = "<br />";

            //get a datatable

            var tbl1 = result.getItem(0);

            for(i = 0; i < tbl1.get_length(); i++)

            {

                //tbl1.getItem(i) will return the ith DataRow

                //getProperty("Column Name") will return the column value from a DataRow

                strRowsInfo += tbl1.getItem(i).getProperty("ProjectName") + strReturn;

            }

            document.getElementById("RowInfo").innerHTML = strRowsInfo;

        }

by Glav | with no comments
Still book writing....
Friday, December 30, 2005 11:35 PM

Its 12.30am, family is asleep, its now December 31st, the last day of the year, and I am still slogging away writing a chapter on our "Beginning AJAX Programming in ASP.NET book". I need to get this chapter in soon and my eyes feel like they are bleeding.

I haven't been posting to this blog much at all, nor visiting mail lists, newsgroups and all the regular stuff I normally do.

Ah the glamour life of an author.

I hope everybody has a great start to the new year.

ASP.NET Podcast #31 - I do a talk on WSE3 (and Merry Xmas)
Thursday, December 22, 2005 3:02 PM

Another podcast out the door! This is a pre-christmas show and may be (but depends on time) the last one for the year.

In this show I talk about the Web Service Enhancements V3 (WSE3) and listout some tips and techniques that I have used to overcome some issues when using some of the turnkey policies in WSE3. You can choose to subscribe ( I hear rumours that subscribing to this podcast is so good, that it can also assist in growing back severed limbs...) or you can download direct.

Dont forget to check out the ASP.NET Podcast site here ( http://aspnetpodcast.com ). Show notes for this show are below:

- Many thanks to all our listeners
- Merry Xmas
- A very quick look at 2005
- The ASP.NET AJAX book (yes....again)

- Tech Talk on Web Service Enhancements 3 (WSE3)
-- Security implementation guidance doc recently released
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/wssp.asp
-- Service Principal Instructions

grab the SETSPN.EXE tool from the windows resource kit tools
>> SETSPN {principalName} {accountName}
>> setspn HOST/{machine} DOMAIN\account
>> setspn HOST/{machine}.domain.com DOMAIN\account
>> setspn HTTP/{machine} DOMAIN\account
>> setspn HTTP/{machine}.domain.com DOMAIN\account

eg.
SETSPN HOST/mypc MYDOMAIN\fred
SETSPN HOST/mypc.MyDomain.com MYDOMAIN\fred
SETSPN HTTP/mypc MYDOMAIN\fred
SETSPN HTTP/mypc.MyDomain.com MYDOMAIN\fred


Client Code for WSE3
- UsernameForCertificate

MyWSE3ServiceProxy svc = new MyWSE3ServiceProxy();
UsernameToken tok;
// If the user token is sent in plain text, then the TokenManager will try and
// authenticate against the ActiveDir/LocalMachine automatically.
tok = new UsernameToken("username", "password", PasswordOption.SendPlainText);
svc.SetClientCredential<UsernameToken>(tok);

-Kerberos
To set the target principal in code use:

string targetPrincipalName = "HTTP/" + System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).HostName;
KerberosToken kerbTok = new KerberosToken(targetPrincipalName);

and via the wse3policycache.config file use:
    <kerberosSecurity establishSecurityContext="false" renewExpiredSecurityContext="false" requireSignatureConfirmation="false" messageProtectionOrder="SignBeforeEncrypt" requireDerivedKeys="false" ttlInSeconds="300">
  <token>
   <kerberos targetPrincipal="host/MYPC" impersonationLevel="Impersonation" />
  </token>
      <protection>
        <request signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
        <response signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
        <fault signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="false" />
      </protection>
    </kerberosSecurity>

by Glav | with no comments
Latest ASP.NET Podcasts #29 (Atlas talk) and #30 (Minimizing viewstate #2)
Tuesday, December 20, 2005 11:50 AM

As Wally recently pointed out to me, I have been slack and not listed his last 2 shows on my blog. So to appease Sir Wally, below are the links to the latest shows:

ASP.NET Podcast Show #29 - Atlas User Group Talk
Subscribe - The Wally Way to do things.  Cool.  Hip.  Get iTunes or iPodder.
Download – The Not-Wally Way to do things.  Uncool.  Boring.

ASP.NET Podcast Site.
Note: The audio of the questions from the group is lacking.  I have attempted to improve those sections of the audio file, but it still may not sound quite right.

Show Notes:
On November 29, 2005, Wally did a talk to the Knoxville .NET User Group on the subject of Microsoft's Atlas.  The powerpoint slides from the talk.
Scott Forsyth of ORCSWeb is the Database Geek of the Week.

 

ASP.NET Podcast Show #30 - Minimizing the ASP.NET ViewState Part #2
Subscribe - The Wally Way to do things.  Cool.  Hip.  Get iTunes or iPodder.
Download – The Not-Wally Way to do things.  Uncool.  Boring.

Check us out on the ASP.NET Site.
Show Notes:

Scott Allen isn’t the only person that needs more Wally.  We got an email from Bruce Dickinson.  He says “I got a fever, and the only prescription is more Wally!”  He has got to have “more Wally.”  You need to listen to the ASP.NET Podcast.
Correction from the previous podcast.  DnD in Atlas does work, its just not documented well at this moment.  Thanks to Wilco Bauwer.
As we get into the Holiday Season, whether it is Christmas, Hanukah, Kwanza or something else, we need to look at how we act towards each other. 
As some of you know, there has been a lot of public discussion back and forth in the .NET community in South Carolina.  I have had some amount of a little bit of knowledge about this as one of the people involved is a buddy of mine and worked on our ADO.NET book.  As I watched the issues play out, I looked at myself.

Hard for technology people to work with each other.
We strike out at each other.
I’ve done it.
I’ve had it done to me.
How should we act?  We need to be open and honest without being rude to each other.  Learn how to work together.  Learn how to pump people up instead of pushing people down.  There are plenty of people that want to push you down.

SavePageToPersistenceMedium code:

string strViewStateKey = this.CreateFileName();
string FileDir = GetConfigInformation();
CleanUpInfo cui = new CleanUpInfo();
cui.Dir = FileDir;
cui.TimeOut = 60*60;
ThreadPool.GetAvailableThreads(out iMaxWorkerThrds, out iMaxIOThrds);
if (iMaxWorkerThrds > giMinimumThreads)
{
            ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(CleanUpFileDirectory),cui);
            Thread.Sleep(0);
}
RegisterHiddenField("__VIEWSTATE_KEY", strViewStateKey);
RegisterHiddenField("__VIEWSTATE", String.Empty);
strViewStateKey = System.IO.Path.Combine(FileDir, strViewStateKey);
LosFormatter los = new LosFormatter();
StringWriter writer = new StringWriter();

// serialize the view state into a base-64 encoded string
los.Serialize(writer, viewState);

// save the string to disk
StreamWriter sw = File.CreateText(strViewStateKey);
sw.Write(writer.ToString());
sw.Close();      

LoadPageStateFromPersistenceMedium:

string ViewStateFile = System.IO.Path.Combine(Server.MapPath(GetConfigInformation()), Request.Form["__VIEWSTATE_KEY"]);
LosFormatter los = new LosFormatter();
StreamReader reader= File.OpenText(ViewStateFile);
string viewStateString = reader.ReadToEnd();
reader.Close();
obj = los.Deserialize(viewStateString);

Cleanup Routine:

int i = 0;
CleanUpInfo cui = (CleanUpInfo)obj;
string strDir = cui.Dir;
double dblTimeOut = -cui.TimeOut;
DirectoryInfo di = new System.IO.DirectoryInfo(strDir);
FileSystemInfo[] fileInfo;
fileInfo = di.GetFileSystemInfos();
for(i = 0 ; i < fileInfo.Length; i++)
{
            try
            {
                        if ((fileInfo[i].CreationTime < (DateTime.Now.AddSeconds(dblTimeOut))&&
                                    (fileInfo[i].Name != gErrorName)))
                        {
                                    fileInfo[i].Delete();
                        }
            }
            catch(System.UnauthorizedAccessException uaeExc)
            {
                        LogError(uaeExc);
            }
            finally
            {
            }
}

private static void LogError(System.UnauthorizedAccessException uaeExc)
{
            LogError((System.Exception)uaeExc);
}

private static void LogError(System.Exception sysExc)
{
            string FileDir = GetConfigInformation();
            string strErrorLog = gErrorName;
            string strFileName = System.IO.Path.Combine(FileDir, strErrorLog);
            StreamWriter sw = new StreamWriter(strFileName, true);
            sw.WriteLine("Time: " + DateTime.Now.ToString() + ", Exception message: " + sysExc.Message.ToString());
            sw.Close();
            sw = null;
}

by Glav | with no comments
WSE3 and "Username over Certifficate" turnkey policy
Sunday, December 4, 2005 10:23 PM

I have been doing a bit of work with Web Service Enhancements V3 and its various turnkey security policies lately. WSE3 offers simplified policy implementation via the use of these "turnkey policies". Basically, WSE2 supported (as best as it could given the incomplete standards currently) for WS-Policy. WSE3 takes a different approach and doesn't really offer WS-Policy support, however offers direct support for these turnkey scenario's which are just implementations of some of the more popular WS-Policy implementations. Kind of like pre-packaged WS-Policy solutions.

The WSE3 implementation still uses a WSE3PolicyCache.config file so you can be forgiven for confusing this with WS-Policy. However, the intention of this post is a brief mention of some problems I had with the "Username over Certificate" turnkey policy that WSE3 offers. Basically, you can use a simple plain text username token for authentication purposes, and use a certificate to sign and encrypt that message making it pretty secure (well ok, more secure than simple "Username over Transport" policy without SSL ...)

The solution I was working on was using IIS6 and a specific application pool with the identity defined as the default NETWORK SERVICE user. The web.config of the services being exposed had an explicit statement to impersonate a particular domain user, like:

<identity impersonate="true" username="DOMAIN\someUser" password="somePassword" />

I had given access to almost everybody on the system to the certificate file store as I was having problems getting the WSE3 subsystem to authenticate correctly, in the hope I could identify it as an access issue. The error I was receiving was something like:

"Unable to access the file specified."

(Side Note: If you ever write a system that outputs an error like this, please give the name of the file I apparently "specified")

At any rate, after a quick chat with a fellow readify colleague (thanks Martin), he pointed me to the obvious that the system should be using the domain user as the application pool identity, and not impersonating via the web.config. Once I had assigned the permissions to the domain user to run the services as an ASP.NET application (and ofcourse removed the <identity impersonate="true" .... statement from the web.config) it now works fine.

Just thought I'd post this up for anybody else trying to do somethig similar.

by Glav | with no comments
Atlas Presentation for the Sydney User Group
Sunday, December 4, 2005 9:53 PM

Last Thursday I did an Atlas presentation for the Sydney Deep .Net User Group. It was a packed house and the presentation went extremelly well. I was getting asked heaps of questions, and the mood of the presentation was light and entertaining (or at least I thought it was :-) )

I promised I would make available the presentation and the code that I used/wrote on the night. So as promised, you can download them from here ( http://www.theglavs.com/ArticleDownloads/AtlasPresentationWithCode.zip ).

If there are any questions, please feel free to fire them off to me via this blog and I'll do my best to address them.

by Glav | with no comments
More Posts

This Blog

Syndication