July 2004 - Posts - Ruari (Chuck's) Mind
in

dotnet.org.za

South African .NET Developer Portal

Ruari (Chuck's) Mind

Life.. whats that?

July 2004 - Posts

  • Web Services (Client Session State)

    Just a note to myself with respect to Session state and Web Services, Web Services are generally stateless and a webmethod will create a new session for each call. To maintain state there are two ways:

    1. Application Variable which will maintain you objects across all systems that access the application instance.

    2. Using Client Session state, which is a cookie based way of maintaining session Id's, basically the server will maintain a Session Variable and pass the Session ID to the calling client in a cookie, however the client needs to be made cookie aware. The idea is that on any subsequent calls the client passes the Session ID back to the server and the server then uses that session again, thus maintaining your objects values. (Word of warning, this works a per instance of the WS proxy, in other words, you need to instantiate the proxy on application load, every time you instant at the proxy, you get a new session, which makes sense, but can play havoc if you neglect the fact). The only thing I still need to investigate is how it handles session timeouts, if client software takes to long to use the proxy again.

    Quick example on how to use Session State:
    1. Firstly you need to use the EnableSession attribute on the webmethod on the Web Service:
    [WebMethod(EnableSession=true)]

    2. Now we can put objects into the session variable and take objects out with normal session variable calls:
    Session["GameInfo"] = mGameInfo;
    GameInfo mGameInfo = (GameInfo) Session["GameInfo"];

    3.When we need to enable Cookies on the client and Attach the Container to the Proxy Object

    private
    AhmedWS.AhmedWS mAhmedWS;

    mAhmedWS = new PlayAhmed.AhmedWS.AhmedWS();
    mAhmedWS.CookieContainer = new System.Net.CookieContainer();

    Posted Jul 29 2004, 08:54 AM by ruari with 1 comment(s)
    Filed under:
  • In heaven (Yukon Beta 2)

    Yeeeha, just received my Whidbey Beta 1 DVD (ok so I did have it downloaded last week), and Yukon Beta2 is ready for download, That's right, my bandwidth tonight is streaming as fast as it can, but the link to the US looks a bit overloaded, Oh well that's why I have 24x7 wireless, now I can go to bed and let it download Yukon. It's going to be a late night tomorrow, got toys must play!

  • I think I'm in love

    2005 Mustang. Nuf said!!!

    Posted Jul 26 2004, 09:09 PM by ruari with 4 comment(s)
    Filed under:
  • Teaching Old dog new tricks

    This is what I love about SADeveloper, the members are soooo keeen, I got to thank Deon for inspiring to teach this old dog that Direct-X is not that hard. Yes I am supposed to be wrapping up the material from my Web Service, talk so I can post it. I'll go do that now, but check it out, I admit I was following a Tut, but I got my first MDX applet to run. Nothing fancy, just a 2d triangle, but I can feel the bug biting, who knows, maybe I'll learn a new trick.

    using System;

    using System.Drawing;

    using System.Collections;

    using System.ComponentModel;

    using System.Windows.Forms;

    using System.Data;

     

    using Microsoft.DirectX;

    using Microsoft.DirectX.Direct3D;

     

    namespace DirectXTest

    {

           public class frmFirstMDX : System.Windows.Forms.Form

           {

                  private Device mDevice = null;

                  private System.ComponentModel.Container mComponent = null;

     

                  public frmFirstMDX()

                  {

                         InitializeComponent();

                         this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);

                  }

     

                  protected override void Dispose( bool disposing )

                  {

                         if( disposing )

                         {

                               if (mComponent != null)

                               {

                                      mComponent.Dispose();

                               }

                         }

                         base.Dispose( disposing );

                  }

     

                  #region Windows Form Designer generated code

                  private void InitializeComponent()

                  {

                         this.mComponent = new System.ComponentModel.Container();

                         this.Size = new System.Drawing.Size(300,300);

                         this.Text = "frmFirstMDX";

                  }

     

                  protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)

                  {

                         mDevice.Clear(ClearFlags.Target, System.Drawing.Color.CornflowerBlue, 1.0f, 0);

                         CustomVertex.TransformedColored[] mPoints = new CustomVertex.TransformedColored[3];

                         //Set up our Triange

                         mPoints[0].SetPosition(new Vector4(this.Width / 2.0f, 50.0f, 0.5f, 1.0f));

                         mPoints[0].Color = System.Drawing.Color.Aqua.ToArgb();

                         mPoints[1].SetPosition(new Vector4(this.Width - (this.Width / 5.0f), this.Height - (this.Height / 5.0f), 0.5f, 1.0f));

                         mPoints[1].Color = System.Drawing.Color.Black.ToArgb();

                         mPoints[2].SetPosition(new Vector4(this.Width / 5.0f, this.Height - (this.Height / 5.0f), 0.5f, 1.0f));

                         mPoints[2].Color = System.Drawing.Color.Purple.ToArgb();

                         //Tell MDX to draw it

                         mDevice.BeginScene();

                         mDevice.VertexFormat = CustomVertex.TransformedColored.Format;

                         mDevice.DrawUserPrimitives(PrimitiveType.TriangleList, 1, mPoints);

                         mDevice.EndScene();

                         mDevice.Present();

                         this.Invalidate();

                  }

                  #endregion

     

                  [STAThread]

                  static void Main()

                  {

                         using (frmFirstMDX frm = new frmFirstMDX())

                         {

                               // Show form and initialize graphics engine

                               frm.Show();

                               frm.InitializeGraphics();

                               Application.Run(frm);

                         }

                  }

     

                  /// <summary>

                  /// We will initialize our graphics Device here

                  /// </summary>

                  public void InitializeGraphics()

                  {

                         // Set our presentation parameters

                         PresentParameters mPresentParams = new PresentParameters();

                         mPresentParams.Windowed = true;

                         mPresentParams.SwapEffect = SwapEffect.Discard;

                         // Create mDevice

                         mDevice = new Device(0, DeviceType.Hardware, this,

                               CreateFlags.SoftwareVertexProcessing, mPresentParams);

                  }

           }

    }

     

    Posted Jul 25 2004, 09:16 PM by ruari with no comments
    Filed under:
  • Weekend of code review.

    Well that was one intense weekend, I just have to take my hat off to our team, the OMFAS PDT (Old Mutual Fund Administration Services. Product’s Development Team). It has been a very busy week, as I have been assisting with the PM position. (Due to circumstances beyond ours /his control our PM had to take some time off.) The team has really pulled together to assist, and to top it off, they all sacrificed their weekend to assist in end to end testing and Code reviewing this weekend. (we all know how we hate code review), and we pulled it off. It's amazing how when you put your minds together and keep each other motivated, the results are mind blowing. Following this exhausting weekend I can truly say, when done in the right spirit, BUG FESTS work, and having a team like this it was pleasure, I know a few developers that will sleep well tonight. All I can say is PDT, you are a bunch of Champions, your company should be proud!!!, I am. (Now lets fix Em bugs).

    Posted Jul 25 2004, 08:23 PM by ruari with no comments
    Filed under:
  • Lessons Learnt

    Ask any presenter and they will tell you “If it can go wrong it will do so in a live demo”, what they don't add is “At the most inconvenient moment too”. Well I guess it was my own fault, I had the talk down pat, all planned out, all source code ready, nice snippet files all waiting to go, then what do I do, I decide to code this one live, and talk about the different items of the talk as we get to the code. Warning... Don't do it without lots of practice!! (Especially if there is a Video camera in the room)

    Although I must admit, after the first little hiccup, loosing my way a bit and getting my typing fingers in a total knot, things smoothed down and all in all it turned out just fine, even got the application coded and working. (We Web Serviced Ahmed’s Game) Was a great hit too. Now to start planning for the next talk on Security and Web Services, should I use WSE2.0... Oh ye.

  • More seats we Cry.. Yes says Microsoft

    The Patterns and Practices workshops planned for August in Cape town, are such a hit that they were practically booked out before we knew what hit us, Both Microsoft’s and My inbox's were flooded with emails requesting more seats. So what did Microsoft do, they found a bigger venue and have today re-opened the registration, A second chance for those that missed out. Cape Town is really becoming active, no longer can people afford to wait till the last minute to register, it's wake up time, things are starting to really happen down here. WOW, that's more like it, let's get active dudes...... See you there....

  • Upcoming SADeveloper meeting

    As I sit here finalizing my talk on Web Services for the SADeveloper meeting on Friday, I made a few startling realizations.
    1. Friday is the 23 July 2004, we had our first SADeveloper meeting in Cape Town a year ago on the 25 July 2003.
    2. The topic for that meeting was Consuming a Web Service.
    3. I spoke at that meeting as well.
    4. The hosting Company was Organized by a friend “Lindy”, as was this meetings. (Both she worked / works for)

    Differences, A year ago it was a morning meeting, this one is in the evening.
    This one covers both creating and consuming a Web Service and more (Ok no WSE yet, that's for next time).
    Looks like its going to be an action packed meeting, I'll have to do something special considering, Hmm maybe I'll give away a few books, Aahh A few SADev mugs, they are sooo coool. Mind you I'll have to ask a few tricky questions, and of course we'll have to play Ahmeds game. Wonder if he'll mind if I make a web service out of it. 

    Posted Jul 21 2004, 11:51 PM by ruari with no comments
    Filed under:
  • Microsoft Outlines Quarterly Dividend

    http://www.microsoft.com/presspass/press/2004/jul04/07-20boardPR.asp

    Enough said...  Hmmm me's thinking, “Dev Communities can help out” :-) .You know me, more funky stuff to give to developers; books, software, workshops, more workshops, toys (This one is for you Rudolf, thinking keyboard here :-p ). 

    Posted Jul 21 2004, 12:18 PM by ruari with 1 comment(s)
    Filed under:
  • SADeveloper What a community

    You got to love it, SADeveloper has grown over the past year and is continuing to influence the IT sector. Interesting to note the more one gives the more it encourages others to contribute, and when it’s for the better of the community and the developer I get all mushy again. This time I'd like to welcome Softsource who has been quietly contributing, and now they have taken that extra step. Discounts for SADeveloper members (keep an eye on www.sadeveloper.net for any new offerings), Thanks guys... sigh, there I go again, warm mushy feeling coming on.

    Posted Jul 21 2004, 10:26 AM by ruari with no comments
    Filed under:
  • WSE1.0 to WSE2.0

    Ok I have been quite again, this time blame the Web Services Extensions 2.0 (WSE2.0). I coded a secure Web Service using WSE1.0 and the IPasswordProvider, which is not in WSE2.0. Instead now you make use of UsenameTokenManager. A few other interesting changes when using a custom password/Username manager are:
    HTTPSoapContext.RequestContext  => RequestSoapContext.Current Off the relevant WSE namespace
    *Object of* SoapContext.TimeStamp.Ttl => *Object of* SoapContext.Security.Timestamp.TtlInSeconds
    Ttl was also in milli seconds
    Security.Signature => Security.MessageSignature

    That's what I've stumbled across so far in my merge to WSE2.0, I have seen plenty other changes but these have impacted me directly.
    I'll post to SADeveloper as soon as I get my head around things. I must admit I have seen some interesting behavior changes with the new UsenameTokenManager over IPasswordProvider on Windows 2000 Pro, but I'm busy validating that at the moment, hopefully I'll do lots more postings on this subject.

  • Patterns and Practices come to Cape Town

    Wow the sessions have barely been opened for registration and they are fully booked. Microsoft is brining the Patterns and Practices workshops to Cape Town in August, I am impressed at how the developers of Cape Town have flocked to these events (way to go Cape Town). Guess we going to have to try get more seats. Anyone looking for details can see www.sadeveloper.net . Keep an eye there to see if we get some more space.

  • Talk to Honours Students

    What an experience!!! Today I was honoured (no pun intended) to be invited by Microsoft to give a short talk to a team of Honours students from the university of Fort Hare (ex East London for the uneducated like myself). The talk topic was to be “Choice of a Champion”, (now I blush). What a fantastic group of people, I was on such a buzz after the talk, and chatting to them afterwards only increased my high. Guys and Girls, thanks for the opportunity to present to you and thank you for reminding me that in this world of increased cynics there are still people with the drive you have, best of luck in your studies, and may you all achieve you desires. Thanks Microsoft for this invite, and introducing me to such exciting people, it certainly gives one that little extra push to make things happen. 
    Posted Jul 15 2004, 05:53 PM by ruari with 2 comment(s)
    Filed under:
  • Visual Studio 2005 Beta1 Installed

    Ye baby I finally got it downloaded. Just installed it on a VPC. The install was pretty uneventful, very smooth (apart from it insisting I uninstall the previous version it found (oh well I'd kinda expect that from Beta stuff)
    Firing it up for the first time I got presented with a dialog inviting me to join the customer experience improvement program, oh well why not? here we  go. Even in Beta some menus seem to come up blank, unless my install was not as smooth as I thought.

    The following menu's showed up blank subs, “Quality Tools”, “Performance Tools” hmmmm.

    Lots of nice new productivity features, but if I had to pick a favorite (ye I know it's a simple one, but it rocks for me) is when you editing some code look to the left of your code, you will see a thin yellow line appear by your changes, this indicates changes and unsaved code, now save it, the line turns green. Next time you open the file the line is gone. As I said simple feature, but for me a way cool feature. Especially when you dealing with many changes over large projects.

    In terms of the code changes, I think I'd have to say Generics take it for me, if you go onto www.sadeveloper.net, you should find in the article section a series of articles I wrote when SADeveloper was starting out on writing your own custom collection class (Strong typed collections.... Predecessor to Generics). So for me it's great to see what Microsoft has done with Generics - well done

    And I could go on all night... The team stuff is what I’m hunting for now... where is Whitehorse? I thought it was meant to be here? A hunting I will go... a hunting I will go... I'm sure I'll have something to feedback as soon as I find it.

     

  • Cape Town where else?

    Sorry but I just had to share one of my recent photo's with you, makes you feel all warm and mushy inside, don't it?
    Just think that could be you, sigh.

    Posted Jul 12 2004, 11:05 PM by ruari with 2 comment(s)
    Filed under:
More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems