Scott Hanselman

InfoPath 2003 and the use of ProgIds in XML PIs (Processing Instructions)

April 30, '03 Comments [2] Posted in Web Services | XML
Sponsored By

Office 2003 XML Shell Extension.
I also noticed that Office 2003 must've installed some shell helper for XML files, because when I saved the file to my desktop, the shell peeked inside the XML file and gave me an XML document icon with the Excel icon overlaid across the upper left corner. I wonder why the file opened in my browser on double-click instead of into Excel...[
The .NET Guy]

I noticed this as well. Office seems to achieve this cute bit of functionality by inserting a PI into the XML instance document which the shell extension just scans all .XML files for to determine if the file should be opened with a specific Office application. The PI looks like this:
     <?mso-application progid="InfoPath.Document"?>
[
Drew's Blog]

Isn't it interesting that ProgIds continue to be used like this, as a component identifier?  Is the use of a ProgId kosher in a .NET world?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Visual Studio.NET 2003/Windows Server 2003 launch in Portland

April 29, '03 Comments [1] Posted in Web Services
Sponsored By

Thanks to everyone who attended the Portland Launch for Visual Studio.NET 2003/Windows Server 2003.  I've posted the slides on this site, so here's the link to last weeks Seattle Launch.  You'll find all the code and slides there.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Physics and No-Touch Deployment WinForms

April 27, '03 Comments [4] Posted in Web Services | TechEd | Speaking
Sponsored By

Folks who know me know that I've been going to school in the evenings on and off for a decade++.  I'm at Corillian by day (and sometimes at three in the morning!), but by night (T/Th/F 6-10) I'm usually in class.  Many a day I've ran from the airport straight to a lab - actually last week I ran from the launch event to class, with only 5 minutes to spare. 

Being the wonk I am, I usually look to integrate .NET into anything I do.  In my recent Group Dynamics class I gave a presentation about my intercultural experiences presenting .NET topics at TechEd Malaysia.  In my Operating Systems class, I was the only guy to write the Tiny Abstract OS using C#.

Anyway, I'm currently in the final term of Physics and Calculus. While the current topics are Electromagnetic fields, we're expected to turn in a final project of some kind.  Some folks are rolling cars down hills, or riding elevators, or playing with lasers.  However, when I think Physics, I think No-Touch Deployment WinForms, don't you?  I mean, who doesn't.  Our teacher oftens goes online and shows us all classes of Java Applets that demonstrate particle dynamics and various Physics concepts.  I noticed that she had no problem finding all the Java examples she needed, no doubt due to Java's deep entrenchment in academia. 

I decided to write up a little application that would solve a problem we worked on a lot last term.  If you take some amount of water of a certain temperature and some amount of ice at a certain temperature and put them together, some amount (or all of the) of ice melts and the water is left at a final temperature.  My little quickie app calculates all of the energy and heat involves and presents the results in a fairly dynamic way.  It should run in 1.0 and 1.1 and should launch out directly from the browser.  It certainly requires a little extra thought around issues like security.  While my IceMelter isn't as polished and cool as Wahoo! it was fun to write and helped me apply what I know (.NET) to something I don't (Physics). 

You can play with IceMelter if you like.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

XSD.exe is kicking my butt, man...redux

April 25, '03 Comments [5] Posted in Web Services | XML | Tools
Sponsored By

Decomposing XSD and WSDL into abstract definitions of types and messages is a good thing, but it appears that Microsoft’s tools don’t adequately support embracing this approach? Or, I'm completely sans clue.  For example, XSD.exe doesn’t seem to be able to cope with xs:import elements when generating wrapper classes.  WSDL.exe has the same problem. 

Anyone have any thoughts on this?  I'd like NOT to wait until Whidbey to be able to describe my messages and contracts and generate a schtickel of code.  Updated with Note: Rant retracted...for now! See below ;)

Here’s a very trivial example straight from Dare's great MSDN Article.

Import.xsd:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema 
targetNamespace="http://www.import.org" 
elementFormDefault="qualified"> 
      <xs:complexType name="rootType" >  
            <xs:sequence>
                  <xs:element name="child1" type="xs:string" maxOccurs="2" />
                  <xs:element name="child2" type="xs:string"/>
            </xs:sequence>
      </xs:complexType>
</xs:schema>

The Outer xsd:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema
 targetNamespace="http://www.example.org
 xmlns:tns="http://www.example.org"
 xmlns:imp="http://www.import.org">
<xs:import namespace="http://www.import.org" schemaLocation="file:///c:/import.xsd"/>
 <xs:element name="root" type="imp:rootType" />
</xs:schema>

This schema appears to be valid – in fact, the .NET framework agrees.  But when you try and run the outer schema through xsd.exe, you get the following error:

C:\>xsd /c root.xsd
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Schema validation warning: Type 'http://www.import.org:rootType' is not declared
. An error occurred at file:///C:/root.xsd, (10, 3).

Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.

Error: Error generating classes for schema 'root'.
  - The datatype 'http://www.import.org:rootType' is missing.

Update: Tomas was kind enough to point out not only that I had originally posted the same schema TWICE, doh!  But also, more importantly, that XSD.EXE doesn't resolve schemaLocation on imports or includes, presuambly because the W3C Schema spec describes the schemaLocation attribute as a hint, not a true location.

I'm back in business as I ran XSD.EXE again with all necessary files specified on the commandline, in order to give XSD.EXE a choice of namespaces - as opposed to hoping it would somehow glean my intent!

I'm too used to using XMLSpy, XSLT and other tools for generating CS code.  Good stuff, thanks Tomas!  Not only was I without a clue, I was also sin una pistasans indice - Ich war ohne einen Anhaltspunkt.  That'll teach me not to post a rant in haste! 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Windows Server 2003/Visual Studio 2003 Launch

April 24, '03 Comments [1] Posted in Web Services | ASP.NET | XML | Tools
Sponsored By

Just got back from the Windows Server 2003/Visual Studio 2003 Launch in Seattle.  Had a freakin' blast.  Great crowd, looked like 2000 people or so. 

Here's the Web Services Enhancements PowerPoint Deck and Code Samples for my WSE Presentation at today's event.  I'll be at the Portland Launch Event on Tues, so stop by!

Some nice folks commented on my sometimes unorthodox Presentation style...take a look at my Tips for Giving a Good [Microsoft] Presentation.  I hope that more people start using tips like "devenv /fs 14" (devenv /fs 8 to revert) and Zoomin.  Of course, a few folks suggested I not quit my day job.  So much for my burgeoning stand-up comedy career. :)

Also, here's my growing list of useful Web Services tools:

The Tools I used in the Presentation

And be sure to get Yasser Shohoud's great book Real World XML Web Services 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.