Scott Hanselman

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

How to run ASP.NET 1.0 and 1.1 on the same box

April 23, '03 Comments [0] Posted in Web Services | ASP.NET
Sponsored By

Old news I'm sure, but here's a great FAQ on how to simultaneously run ASP.NET 1.0 and 1.1 on the same box (using Windows .NET Framework 1.0 and Windows .NET Framework 1.1 on various IIS "Applications"). Useful stuff, and very easy.

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

NEW: Doculabs Web Services Benchmark is out

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

This just in.  Today the Doculabs "@Bench" Web Services Benchmark came out.  Here's a snippet from the Table of Contents to give you an idea of the scenarios they tried:

Summary Results: Application Server X on Windows 2000 and Oracle9i
Summary Results: Application Server Y on Windows 2000 and Oracle9i
Summary Results: JBoss on Red Hat Linux 8.0 and Oracle9i

Summary Results: .NET 1.1 on Windows 2000 and Oracle9i
Summary Results: .NET 1.1 on Windows 2003 and Oracle9i

Summary Results: .NET 1.1 on Windows 2003 and SQL Server 2000

The results you ask?  Let's just summarize by saying:

  • Windows and the .NET Framework is the Best Platform for Web Services
  • JBoss on Linux was the fastest Java system (!)
  • Web Services on J2EE offers inconsistant performance
  • Oracle on Windows 2003 Server is a very viable option
  • Windows 2003 Server and Oracle offered a 37% increase in throughput compared to Windows 2000 and Oracle
  • Windows 2003 Server and SQL2k offered roughtly an 38% increase in throughput compared to Windows 2003 and Oracle

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

WSDL and Deem's Dime Dogfood :)

April 21, '03 Comments [0] Posted in Web Services | XML
Sponsored By

I'm presenting on WSE (Web Services Enhancements) at the Visual Studio/Windows Server 2003 launch in Seattle on Thursday, and while going through an internal Rough Draft my CTO Chris Brooks, brought up the question, but where does WSDL define DIME.  My short answer was, "Hell if I know, it's out of band" and Chris said "that's not good enough."  So, a little poking around led us to Mike Deem's DIME WSDL Extension roughspec/RFC.  What's going on in this space?  There's a cacophony of WS-KitchenSink specs out there with all their glorious interrelationships, and WSDL a tricky touch point.  I know some folks have strong opinions about WSDL, but regardless, WSDL clearly, as XML is wont to do, can be twisted and turned to fit, but should it be? And until then should I just chalk DIME up as out-of-band literally and contractually?  Or do I eat Deem's Dogfood?

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.