Rants, rambles, news and notes from another geek

My PGP Public Key

I wanted to post my PGP Public Key here in case anyone is looking for it. I had it on my old site, but it wasn’t listed here. Here is the ASC file for download:

UPDATE 2004-05-02: To avoid the DRY Principle, I have pulled that link. If you are looking for my PGP Public Key, please visit this page.

WSDL-First Development

As I mentioned yesterday, I’m trying to get comfortable with WSDL First development of web services. Deep down inside it makes sense to me (I come from ATL/COM land so defining my interface first just makes sense to me).

So I went through the XSD tutorial I mentioned and made a schema for the CRM project. No problem.

But before tackling a web service that large, I decided to create a little spike solution first to test a couple of things. I tryed in the first WSDL sample from chapter 6 of the O’Reilly book Web Services Essentials├é by Ethan Cerami (pp122-123).

I then used wsdl.exe with the /server flag to produce a base class. Imported it into my project and derived my web service from it. Added the override for the abstract method and pow! I had a working WSDL first web service.

But one thing bugs me… when I ask the .ASMX file for the WSDL, I get something that looks very different from what I started with:

  • Most of the names have changed (not the operations). This doesn’t really matter, but it is a difference.
  • The first time I did this the new WSDL had a section with a element that defined the messages. My original├é didn’t have this. Then I remembered to copy the attributes from the base class to my code-behind class and that went away.
  • The binding/soap:binding element now has the style=”document” attribute, but my original WSDL had style=”rpc”
  • The binding/operation/soap:operation element now had style=”rpc” but my original didn’t have a style element at all.
  • My original WSDL fifn’t have a section. The new one does.

Now I don’t think most of these are important, but the “document/rpc” thing has me worried. I think the end result will cause client proxies to produce the same SOAP messages, but I’m not 100% sure.

Has anyone explored this further with a more complicated WSDL? Perhaps one with a ?

.NET Web Services and the WS-I Basic Profile

I’ve spent much of the day using with the WS-I Testing Tools├é to test a very simple .NET Web Service and I’m surprised by what I’m finding.

My first test was to uncomment the HelloWorld method. I massaged the analyzerConfigBinding.xml configuration file from the WS-I samples directory so that it called my webservice. It passed with flying colors.

The next thing I wanted to try was passing my own classes back from a web service. I creates a fairly complex class model that defined a Contacts class containing Contact objects, each of which has properties like FirstName, Address, etc.

Once again it passes. So far so good. But what about DataSets?

I have seen countless demonstrations by MS people showing DataSets passed to and from web services. While I’ve never been much of a fan of this myself, I didn’t have a good reason other than vague “concerns” about interoperability. It appears that my concerns are well founded as I have not been able to get a DataSet to pass through the WS-I analyzer.

I created a simple Web Method that returned a DataSet. It failed on tests WSI2102, WSI2122, and WSI2703.

The first test (2102) fails because the element contains an element that specifies http://www.w3.org/2001/XMLSchema├é as the namespace. There isn’t a valid schema file at that URL. Maybe they meant http://www.w3.org/2001/XMLSchema.xsd?

The second (2122) and third (2703) tests fail because deep down in the section of the WSDL, a DataSet is defined as being a sequence of a followed by . What I think is happening here is that it is telling us that the schema for the dataset will be sent with the dataset itself. This apparently isn’t allowed in WS-I Basic Profile. (Now that I write this, I think I understand what InfoPath is complaining about when I tried to have it consume a DataSet from a webservice.)

So plain-jane DataSets are out. What about typed DataSets? I created a simple typed DataSet and dragged the authors table from the pubs database onto it. Modified my web service to return this DataSet and…

BOOM! The analyzer tool chokes on the WSDL and throws an InvalidOperationException during XmlSerializer.Deserialize. One thing to note is that the data set definition has changed from the sequence I descibed above to a sequence containing just an element with its namespace attribute set to the address of the XSD file for the DataSet. I suspect the WS-I tool is choking either on the element or on the XSD file. Not sure which at this point.

So, after all of this I think it is safe to say that my original vague feelings about not using DataSets in Web Services was the right thing, even if I didn’t have a good reason why. So how does this affect the old “DataSets vs. Strongly Typed Collection” debate? I think it is obvious where I stand.

The Inventor (Another Meyers-Briggs Test Result)

Apparently, I am an ENTP - Extraverted iNtuitive Thinking Perceiving (according to this test). I ran through the answers pretty quickly using my gut instinct for most of the answers.

D. Keirsy calls this type The Inventor. Hmmm… I wonder if people who know me agree or not.

Simplegeek asks “Is ENTJ (his type) a good thing or a bad thing?” I wonder the same thing about ENTP.

XML Schema Tutorial and Best Practices

I’m helping a customer design a web service for their CRM product and I’m trying to use this as an opportunity to teach myself to do WSDL First├é instead of the classic .NET way of letting the implementation generate the WSDL for you.

Of course the first step is in having a good understanding of XSD schemas. I have a pretty good grasp of the basics, but I was looking for some best├é practices and such. After searching through Google Groups for a while I found mention of Roger├é Costello’s xFront site.

If you are wanting to learn a bit about XSD development, head over there and do his XML Schema Tutorial. Then review his XML Schema Best Practices.

Exactly what I was looking for.

TechEd 2003 Presentations Online

In case you didn’t get a chance to go to TechEd this year, I just found that most (all?) of the presentations are available online. I don’t mean just the PowerPoint decks, I mean the whole thing. Decks, audio, everything!

Visit http://microsoft.sitestream.com/ to see it all. Tres cool.

SpamBayes Is BACK!

Wahoo! The most recent release of SpamBayes (version 0.7) works with Outlook 2003. Oh how I have missed thee.

If you don’t know what I’m talking about, this is the best, FREE spam filter around for Outlook. (It doesn’t work with Outlook Express.) It uses Bayesian Filtering and once you train it with couple hundred messages it rarely misses and I’ve never had it get a false positive. SpamBayes absolutely rocks!

NUnit 2.1 Released

It is out… V2.1 highlights:

This is the third major release of NUnit and the second since it was
rewritten to take advantage of .NET custom attributes. Highlights of this release include:

  • Support for the .NET framework versions 1.0 and 1.1
  • The ability to run test suites across multiple assemblies
  • New TestFixtureSetup and TestFixtureTeardown attributes
  • Improvements to the GUI interface
  • New command line switches for both GUI and Console runners
  • Some degree of integration with Visual Studio
  • Tests now execute in the same order as they are displayed in the gui.
  • Substantial improvements in error and exception reporting.
  • Now runs on Windows 98

Download either the msi file or the source zip from the following link:
http://sourceforge.net/project/showfiles.php?group_id=10749&release_id=179125

See the ReadMe.pdf for more info (include in the msi install but not in the source zip).

Busy Weekend

My weekend started when I left work early on Friday with a case of the flu. Ugh. I hate getting sick, but it seems that having a toddler is getting me sick more often than I’m used to.

I went to bed early Friday night because my wife and I had plans to start finishing our basement on Saturday. The kid was going to her “nanna” until Sunday morning. We had a bunch of lumber left over from another project (thanks Eben) and were ready to go.

On Saturday morning my flu seemed to have passed. Emily took the kid first thing and I went into the basement to start clearing stuff away. About 10am, Em returned and we got started. Before we could actually start building walls, we had a couple of other tasks to take care of. The biggest one was a piece of old electrical conduit that was going right through where our new hallway was going to be. This piece of conduit had about 4 bends in it, with the final turn going 90 degrees up into the wall. After a few attempts I figured out how to get it disconnected from the old breaker box and we were able to slide it out.

By this time it is after noon and we stopped for lunch. An hour later we headed back downstairs to start putting up walls. I love construction framing. It is manual labor, but it is fun. If I were rich and didn’t need to work, I would probably do construction during the day, just for fun. (And write code at night for the same reason!)

We snapped a couple of chaulklines on the overhead joists, and then used a plubbob to make matching lines on the floor. A few sawcuts later and we had the top plates attached to the ceiling. Now we had to takle the bottom plates.

My plan was to use Tapcon screws. If you haven’t used these before, you should check them out. There simply is no easier way to put a screw into concrete. You have to use exactly the right size drill bit, but they just work. Amazing!

So I got my handdrill out, put in the Tapcon drill bit and started in. About 30 seconds later the tip of the drill bit melted and I had to stop. Hmmmm… “Maybe I need a hammer drill,” I said to Emily.

And then the power went out. This happens quite often in my house. We call it #10 because about 50% of my 80 year old house is running on the same circuit… number 10 on the panel. I ran outside expecting to flip it back on, but all the circuit breakers were closed. None of them had popped.

So I ran over to the neighbors and sure enough, their power was out too. SHIT! It was 2:30pm.

Needless to say, we didn’t get any more work done in the basement that day. An entire baby-free day and we couldn’t do what we had planned to do. We did rearrange the upstairs of the house and had a fun evening playing gin drinking wine. It was disappointing but fun.

When did the power come back on? 10:30pm. Ugh.

On Sunday morning, I got up early and ran out to rent a hammer drill. It took me only 20 minutes to do all of the concrete holes. Damn that is a cool tool. I don’t think I need one often enough to buy one, but if you are drilling concrete, don’t mess around with a regular drill.