Working with WebServices

by Erik Lane 15. June 2006 17:53

Three things I've hit recently:

1.  You can get an unexpected timeout when you can make a lot of calls at once to the same webservice.
My NUnit tests are hitting our test harness webservice.  If I ran two or three everything would be fine.  But if I ran the complete suite of tests I would start getting an exception after about the third or fourth test.  The exception was "The underlying connection was closed: An unexpected error occurred on a receive".  I'll be honest, I'm not real sure how to actually fix this problem and I don't control the hardware/setup of the site that will host the webservice.
 
I got my fix from Denis Pitcher which had me add some code to the references.cs file to set the KeepAlive property to false.  Microsoft now has a KB article on the topic that explains more about the problem but also has a good suggestion that keeps you from having to update the references.cs file each time you update the web reference.  Just create a new class that inherits from the generated proxy class and then override the GetWebRequest method so you can set the KeepAlive property to false.  Done!
 
2.  Read-only properties are not exposed by XML webservices.
Apparently you have to have both a get and set on objects that you want to expose via your webservice.  This is by design and so now I've got some exceptions in place to keep people from setting values that they shouldn't be.  :-)

3.  Derived classes are not serialized by default like their base classes.
This had me banging my head on the desk while debugging this cool little "feature".  It makes sense now but at the time I was getting pretty frustrated.  Craig Andrea does an excellent job of explaining it an giving an example.  I've seen two ways to get at it this.  Both require using the XmlInclude attribute but one is placing it on the WebMethod and the other is placing it on the base class.  I'm choosing to place it on the base class.  I figure if I need to add another subclass to the mix this will be the only place I'll need to go.
 
Ahh the fun of developing code.  It can be frustrating at times but its still fun.

Tags:

FWDNUG and CodeSmith

by Erik Lane 15. June 2006 04:43

The presenter at this month's FWDNUG meeting will be Rob Howard of Telligent Systems.  There is not enough good things to say about Rob's presentations.  He's very technical and yet very comfortable with the whole "being a presenter" thing.  It all just flows really well.

Attend this months meeting and he'll be providing everyone with a free license to CodeSmith, 2006 best utility of years according to asp.netPRO magazine.  On top of that you'll be saving yourself (or your employer) $499.  I attended the NDDNUG last year and got my free license So if you are in the DFW area go and get yours on June 20th.

Tags:

When is charity not really charity? Odalis Perez knows!

by Erik Lane 14. June 2006 06:10

Poor guy, Odalis Perez has his priorities waaay out of whack and he's no idealist.  He had a program where he would buy Dodger tickets for 45 inner-city kids to attend games on the nights that he was scheduled to pitch.  However, he was removed from the starting rotation and so he suspended his program.  Then when he was put back into the rotation he didn't reinstate the program.  He said it is because he didn't enough recognition or credit for his charitable work.

I'm sorry, part of being charitable is that its CHARITY.  That means to give and not receive.  From Webster's - "generosity and helpfulness especially toward the needy or suffering".

Apparently this wasn't why he was doing it in the first place; but for his own selfish motives.  I'm guessing that's why he never got any credit for it.

via celsius1414

Tags:
Categories: General Musings

Sourcegear Vault Database Password

by Erik Lane 13. June 2006 19:12

Ok, I didn't follow the suggested backup and restore procedure for my Vault database.  I wasn't really thinking of it at the time.  I knew I had a database and wanted to move it to another machine.

So I backed up the database and moved the backup file to the new machine.  Installed Vault 3.1.8 and set the Admin password and chose SQL authentication for the database.  I then restored my backed up database over the one created during the install.

I fired up the Admin tool and kept getting a SQL login failure for user 'sgvault'.  Hrm..I knew what the original database password was (I thought) and so I setup the user in SQL server and tested.  No problemo!  Still no dice when trying to fire up the Admin tool or the Client tool.

Here was my problem - I didn't remember what the database password was.  During the setup process the Admin password that you set is also set as the database password.  From step 6a in the setup guide:

Create a password for the Admin user. If using SQL Server authentication, this password will also be used for the SQL Server login, 'sgvaultuser'. This value is encrypted in the Vault Server's web.config file.

Tags:

How do you pronounce Moleskine?

by Erik Lane 8. June 2006 05:40

Here is another one of those words that you see more than you hear (like emoticon).  I think I first heard of them from Scott Hanselman while reading about his personal systems of organization (very good).  Anywho, last week on my flight home from KC I was listening to Scott's podcast, Hanselminutes show #18, and he discussed his personal organization system.  In that I heard him pronounce Moleskine and boy what I waaaay off on the pronunciation.

I wouldn't have guessed it in 25 tries.  I've always pronounced it as mole-skin or mole-skine.  Negative, it's mol-a-skeen-a.

Giddy Up!

ps. I use the regular size ruled notebook.

Disabling Simple File Sharing

by Erik Lane 8. June 2006 00:42

Man, after setting up my new laptop I didn't realize that simple file sharing was turned on by default if your machine is not part of a domain.  To be honest, I don't think I've ever even used or seen simple file sharing.  I was trying to adjust the security on a folder and all I saw was the simple sharing user interface and I was wondering what the heck was going on.

                      

From the KB article:

If simple file sharing is enabled, you see the simple file sharing user interface appears instead of the Security and Sharing tabs. By default, this new user interface is implemented in Windows XP Home Edition and in Microsoft Windows XP Professional if you are working in a workgroup. If you turn off simple file sharing, the classic Security and Sharing tabs appear, and you can specify which users and groups have access to shared folders on your computer.

Made the change as described in the KB article and back to normal - Woohoo!

                      

Giddy Up!

Tags: