Archive for August, 2008

Error 401 when using ObjectDatasource to call a web service

Recently, I used a ObjectDataSource object to call a web service from an ASP.Net web site. Much to my surprise, I got the following error when I run it:

The request failed with HTTP status 401: Unauthorized.

In addition, the error stated the routine resulted in the following source error:

Line 111:        [return: System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
Line 112:        public string Test() {
Line 113:            object[] results = this.Invoke(“Test”, new object[0]);
Line 114:            return ((string)(results[0]));
Line 115:        }

Apparently, the error occur in line 113, when the web service is invoked. What is annoying is that the error does not appear in the security event log. Reading the IIS log file did not result in further understanding. This post did however gave me a big clue.

What appears to be happening is that the authentication credentials are not being passed to the web service. One would expect that with reflection, the ObjectDataSource would have some seamless way to pass the credentials, but there is not. You will have to create an instance of the web service proxy. A good place to do this is when the ObjectDataSource is being created. Double-click on your objectDataSource’s Object Creating event. This will create an event handler.

protected void MyObjDS_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
MyWebService.Service webProxy = new MyWebService.Service();
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
e.ObjectInstance = webProxy;

In the above example, I am passing my default credential to the web service. This occur was the ObjectDataSource is being created. Note that I am assuming that the URL of the webProxy is already set when you added the web service as a web reference. If you have different web service for each environment (dev, test, prod, etc), you can put the URL in the web.config and add an additional line to set the URL.

protected void MyObjDS_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
MyWebService.Service webProxy = new MyWebService.Service();
webService.Url = ConfigurationManager.AppSettings[“MyWebServiceURL”];
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
e.ObjectInstance = webProxy;


August 31, 2008 at 5:29 pm 6 comments

Fixing “Carrier Stall” error on a Lexmark Z52 Printer

Recently, my Lexmark Z52 stop printing. Whenever I print, I would get the error “Carrier Stall”. The problem was not resolved when I reset the printer several times. I also tried reinstalling the cartridge, but that did not help.

I did some google search and discover the following knowledge base issue. From what I can determine, there is a clear plastic strip right behind the print carriage (where your ink cartridge sits) that the printer reads as it prints. If this cartridge is unreadable, you could get a “Carriage Stall” error or the carriage starts slamming itself against the side of the printer.

The knowledge base article suggest flicking it. This did not help and it would appear that the strip was in place properly. I got out some wet paper towel and carefully wiped it down and then make sure it was back in alignment. This did not immediately fixed the problem, but I figure there was probably some moisture on the strip. I waited overnight for the strip to dry and tried again. This time, the printer worked perfectly.

While I do not guarantee that this will fix your printer, why not give it a try. It cost nothing and it may save another printer from going into the landfill.

August 31, 2008 at 3:46 pm 2 comments

An experence with Linksys CIT200 Skype phone on a low bandwidth DSL line

Recently, I decided to set up a Skype phone for my mother. My relatives are now in different places on the globe and it’s costly to call them on the phone. A good number of them have Skype. She would be able to call them for free.

Ironically, I picked the Linksys CIT200 mainly because it was a single purpose phone. Personally, I would like one of those dual phone that allow me to switch between Skype and the landline. However, my mom can’t even figure out how to use call waiting, so she won’t know if she’s in Skype or landline mode. Since CIT200 is a separate phone, we won’t have that issue. It also doesn’t hurt that I got the phone on sell for $30 from Circuit City.

Opinions about the phone

The phone comes in 3 different components:

  1. The Phone itself – pretty well constructed and uses standard AA batteries. You should be able to find replacement NIMH batteries at most stores.
  2. The charging station – charges the phone. The construction is not very robust. It would be pretty easy to break.
  3. The USB base station – this is the part that hooks up to your computer. On a lot of devices, the base station is the charger. In this case, they are separate.

Installation and set up

Installation is pretty easy. I plugged in the charger unit and place the phone on it. The manual states that it should sit on the charger cradle for at least 14 hours. Next, I install the Skype software and then the CIT200 software.

I created an account on Skype and login. I then plugin the base station, which then triggered an automatic device driver install. I switch on the phone and got a pop up asking if I want to use the phone in Skype. I answer yes and the phone’s status indicate I was online.

The phone uses the Skype software computer to talk. It simply act as a mic and speaker device. In order to use it, your computer must be on and you have to be log into Skype.

What I did was to setup Skype to run and login automatically on startup. I also put in $10 of credit for calls.

I have verify that the CIT200 driver will work under Vista. However, I notice that there’s no uninstaller, so it was a pain to remove the software.

Hardware we’re running on

The hardware we are running on is a pretty slow machine.

  • eMachine T1221. 1.3 Ghz Celeron, 512 Mb memory.
  • USB 2.0 PCI card (since machine is old enough to come with USB 1.1).
  • Buffalo Technology WHR-G125 Wireless-G High-Speed Router with QOS for voice over IP.
  • Veizon DSL 768K/128K

The Experience on a slow DSL

The phone allows you to test your setup by calling echo123, an account that records your voice and then play it back for testing purposes. Frankly, I was alarmed by the poor quality of echo123’s annoucement message. Fortunately, my recorded voice sounded OK.

Even with the slow DSL of 768K download and 128K upload, the phone sounded fine. The sound quality is somewhere between a cell phone and a landline. I did however hear some odd echos when calling a landline. The echo disappeared when I call the person Skype to Skype overseas.

The Buffalo router’s quality of service (QOS) worked great by giving voice over IP packets higher priority. As a result, the voice quality never dropped even when I attempted to download a file. However, the browsing experience is painful when the CIT200 is in use, since the voice is taking over part of the bandwidth.

A button on the bottom of the phone allow the user to select and call Skype users. Alternatively, you can just dial the number, but you have to enter the international code, even if the call is within the US. If you do call someone, the rate varies from country to country. In a lot of places, the charge is about $0.02 per minute with a minimal minutes of about $0.06. If you make a lot of small calls, you can easily use up your credit.

Overall, I think the CIT200 worked really well.

August 30, 2008 at 11:37 pm 4 comments

Tips on Windows File and Print Sharing

In this article, I will explain how Windows file and print sharing works and how to work around problems. The article will cover file and print sharing under a work group and not under an active directory domain. If you don’t know what active directory is, you probably don’t have an active directory domain since they are not trival to setup and maintain. You will only see active directory domains in companies. The article will cover Windows 2000 to Vista.

How the different Window editions Handle File Sharing

Different Windows edition handle networking differently. Windows XP Professional, Windows 2000, and Vista all can handle Advance File Sharing. Windows XP Home is limited to Simple File Sharing.

Windows XP Home

XP Home has a limited version of file sharing call “Simple File Sharing”. There’s a couple of points to remember about Simple File Sharing:

  1. Everyone connects to the server as the account “guest” when you attempt to connect to the shared folder or printer. This is actually the most important behavior to remember about Simple File Sharing. No matter who you are login as on the client machine, when you connect to the XP Home server, it will connect you as guest.
  2. For a shared folder, you can either set the field as read-only or read-write for everyone.
  3. You can hide your share name by ending it with $. Users will be able to connect to that share, but they will not be able to see it. Note that this is not foolproof, there are utilities that allow you to see the hidden shares. Note that $ also works in Advance File Sharing, which we will go into later.

Because everyone connects to the server as guest, you need to make sure that the guest account has no password. If there is a password, users will be prompted for a user name and password when they connect and they will have to enter the guest and the guest’s password. If you disabled the guest account, no one can connect to your machine.

XP Home has no provision for any other form of file and print sharing.

    Windows XP Pro and 2000

    Both windows XP professional and Windows 2000 have advance file and print sharing. The major differences from simple file sharing is the following:

    1. When you connect to the server, your username and password is passed to the server. If the username and password match an account on the server, you will be connected to the server as that user.
    2. You have finer control over permission. For each folder and printer you share, you can specify who can access the folder or printer, and what rights they have over it.

    One thing you must do for advance file sharing is that your user account and password must match across the different machines. The reason for this is security, since you don’t want people being able to get access to resources on your server without knowing the password.

    Even if you give permission to the “everyone” group, you will still be unable to get access to that server resource unless you have a user name and password that match one on the server.

    If your user name and password do not match, you can still get access by playing around with explorer to allow you to connect to the resource as a different user. Note that this is possible but is cumbersome and is not automatic.

    Note that by default, XP Pro has simple file sharing turned on so that it behaves like XP Home. To turn it off, you can go into explorer, select Tool->Folder Option and check or uncheck the option for Simple File Sharing. This mean you can use simple file sharing or advance file sharing in XP. Windows 2000 is limited to advance file sharing only.


    Vista does not have simple file sharing. Vista file and printer sharing works pretty much like advance file sharing. However, there are options to turn off password protection so that you can simulate simple file sharing.

    Guidelines for setting up File and Print Sharing

    Guidelines for Simple File Sharing

    • Make sure that guest account is not disable and do not have a password. If the guest account is disable or have a password, Simple File sharing will not work properly.
    • If you do not want users logging in as guest on XP, go into control panel->user accounts and check the option to disable the guest account. Note that when you disable the user account in control panel user account, it actually just prevents you from logging in, it does not actually disable the account.
    • Your policy should be set such that guest can only login locally. Because guest do not have a password, you want to prevent people from logging into the machine as guest.
    • Keep in mind that everyone can see any directory that you share. Do not put anything in share that you do not want the public to read.
    • Limit write permission only to directory where if users won’t be able to do any damage. Keep in mind that if you set a folder to writable, it will be writable to everyone. Do not ever share the root of your drive to be writable for obvious reasons.

    Guideline for Advance File Sharing

    • Set up your network so that all of the machine on the network has the same work group, user name, and password.
    • You may disable the guest account, since it is not used in Advance File Sharing.

    Solutions to some of the problems you may encountered

    I don’t even have an option to share a folder or printer

    You may need to install the file and sharing component. This will be on our Windows OS disc.

    How do I re-enable my guest account?

    If your guest account is truly disable (as oppose to be just hidden from login), simple file sharing is not going to work. To renable the account, login into the machine with a user that has admin rights. Right-click  on “My Computer”, select the user folder, get properties of the guest user account, and uncheck the disable account checkbox.

    How do I remove my guest account’s password?

    If the guest account is enabled but has a password, the user will be prompted to enter the user name and password when they connect to a server resource. However, when you attempt to remove the password using the graphica interface, it tells you that the policy doesn’t allow accounts without password.

    The easiest way to remove the guest account password is to do it from the command line.

    1. Login to the machine with an admin account.
    2. Open a command window.
    3. Type in the command:

      net user <user name> “”

      The command above change the <user name>’s password to “”.

    If I use advance file sharing, is there a way I can set up the server so that anyone can access the printer?

    No, if you want everything to be seamless. You have to go with Simple File Sharing, which allow everyone to connect as guest and live with the security limitations. If you use advance file sharing, you will need to connect to the server before you can have access to a resource, even if it is opened to everyone.

    Note that I said “seamless”. You can still manually mount the resources, but it won’t work automatically.

    If I have Simple File Sharing on, does this mean I cannot remote desktop to the server because every login is now seen as “guest”?

    No, remote desktop is not the same as file and printer  sharing. The connect as guest only occur when you attempt to link the server for file and printing (technically call SMB protocol). Remote desktop is not affected.

    August 30, 2008 at 10:34 pm 3 comments

    Microsoft MOSS 2007 / WSS 3.0 Deployment Issues

    The following is a list of issues encountered while working with Windows Sharepoint Services (WSS) 3.0 and Microsoft Office Sharepoint Service (MOSS) 2007.

    When I activate the feature, I get “Unable to import feature” and “A file specified in the modules section of this template already exists.”

    Basically, when you activate the feature, it attempts to import your web part, but if you have deployed this web part previously, it will thrown this error. This is the case even if you have retract and deleted the solutions for your web part.

    To fix, go to your feature element files, there should be an entry for the file of the web part such as:

    <File Url="MyWebPart" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false" >

    Make sure that IgnoreIfAlreadyExists is set to true.

    When I add the web part, I get an error saying that the web part cannot be imported. In the WSS log file, there is an error “Exception System.ArgumentException: Value does not fall within the expected range.”

    The web part activates properly, but when I add the web part, I get an error importing the web part. After playing around with it for several hours, I figured out that the problem was URL based. If add the web part when I am browsing the fully qualified name like “;, it will throw that error when I add the web part. However, if I add the web part when I am browsing “http://myserver/myspace&#8221;, it works just fine.

    If you go to Sharepoint Central Admin and select Operations->Alternate Mapping, you’ll see the URL mapped to your application. You must use the mapping listed here or add additional ones.

    August 29, 2008 at 9:41 am 1 comment

    I can’t create a new folder in TFS Sourcecontrol

    Recently, I started working on a project that uses TFS, which I previously have not worked with before. After using it for a few weeks, we had to branch and that’s when it gets interesting. TFS uses location based branching. The branch is an actual new location in the source control. Not knowing this, we created a directory structure like this:


    Ideally, the client and solution should be both grouped under a single folder so that we can just branch the folder and get something like the following


    What I want to do is to move the client and server solution to Main, so I can branch from Main. I attempted to go to the MyProject, right-click on the right  panel in Source Control Explorer and select New Folder, but it was grayed out even though I have admin permission.


    I had previously created the MyClient and MyServer project by adding the solution to TFS. As a result, I ended up with a workspace mapping from MyProject/MyClient and MyProject/MyServer. In order to create the new folders in MyProject, I need to add a folder to MyProject.

    Unless you map a TFS folder to a physical location on your drive in the workspace, you canot add a folder in that directory. It’s actually fairly obvious in hind site, but it’s not immediately obvious the first time.

    August 25, 2008 at 9:02 am 2 comments

    Tips on installing Picasa Linux 2.7 on Linux

    Recently, I attempted to install Picasa 2.7 for Linux for a friend. Even though google’s installation instructions were fairly simple, I encountered a lot of problems starting it. Here’s are some tips on avoiding the problems I encountered

    Do not start Picasa as root or sudo

    Picasa has to be installed as root, but you should never start Picasa as root or do sudo picasa. When you run Picasa, it writes a .picasa directory in your home directory. If you run it as root or use sudo (which cause Picasa to run as root), the .picasa directory will be owned by root. As a result, when you try to run Picasa as yourself, you will be unable to write to it. Do a ls -la in your home directory. If .picasa is not owned by you, your Picasa configuration is messed up. To correct, delete the .picassa directory and run again or change the owner of the .picasa and its subdirectory to you.

    Be patient the first time you run it

    The first time I ran Picasa, it launched with the Picasa cursor. After a while, the cursor disappear, but I cannot see any Picasa, so I tried running it again and also try to kill off the rogue Picasa processes. It turns out that it takes a really long time to start up the first time. The first time you start Picasa, it will attempt to create Wine directories, this apparently takes a long time depending on the speed and memory of your machine.

    So the first time you run Picasa, take a walk around the neighborhood and get a cup of coffee. By the time you get back, you should see the screen prompting you with the Picasa agreement.

    Picasa is ultra-slow in a Virtualbox

    PIcasa is almost unusable in a Virtualbox emulator linux guest (it may work better in Vmware, but I haven’t tested this) There is a several second lag when you click on a menu and the cpu is loaded by 30%. It’s possible that it’s slow because it has to read files off a virtual disk, or may be it needs hardware graphics acceleration. Do not bother running Picasa in a Linux guest.

    August 19, 2008 at 7:50 pm Leave a comment

    Older Posts


    August 2008
    M T W T F S S
    « Jul   Sep »

    Posts by Month

    Posts by Category