Out of Office issue with hosted Exchange2007

September 20th, 2008

1and1 have upgraded me to Exchange2007, which is nice. I’m liking the flagging features now available on my Windows Mobile device.

I ran into an issue, which 1and1 refused to help me solve due to it being ‘out of our scope of support’. They’re support is ‘will provide you the necessary settings for you to be able to setup your exchange account in your Outlook 2007’. As far as I’m concerned not being able to view the Out of Office options comes under they’re support.

My situation is I have my exchange server hosted with 1and1, and the domain not. I’m not sure if I would have the same issue whether I had the domain hosted with them or not.

When Outlook 2007 starts up it attempts to connect to autodiscover.lukesmith.net (as lukesmith.net is the domain of the email), which obviously didn’t exist as exchange isn’t at that domain and so certificate warnings were being shown, and OOF not working.

"Your Out of Office settings cannot be displayed, because the server is currently unavailable. Try again later".

All I was after from 1and1 support was the URL for the their exchange autodiscover so I could setup a CNAME record in my DNS settings for the domain. So after getting a reply (which was quite quick even if it wasn’t helpful) I broke out fiddler and watched the requests outlook was making. It turns out it was making the request to http://autodiscover.lukesmith.net/autodiscover/autodiscover.xml. So a few more tries and I discovered http://exchange.1and1.co.uk/autodiscover/autodiscover.xml was requiring authentication and after authenticating returning an xml response.

Adding the DNS record below fixed the issue of not being able to use Out of Office replies though I’m still getting the certificate errors. These used to occur when connecting to Exchange2003, but stopped after a while.

autodiscover.lukesmith.net CNAME exchange.1and1.co.uk

GeoJSON for Virtual Earth

September 9th, 2008

For my new project I decided to make use of GeoJSON, a standard for representing geo data in JSON format, rather than returning KML, georss to the client, or some custom format.

From a quick look online there wasn’t much in the way of using Virtual Earth with GeoJSON, I found one blog post that was the inspiration behind doing VEGeoJSON.

The VEGeoJSON library provides two functions (not much of a library)

  • addGeoJSON(data, onLayerCreated, onShapeCreated)
  • getGeoJSON(onGeometryCreated)

As a quick example of its usage

var v = new VEGeoJson(map);
var geoJson = v.getGeoJSON();

VEGeoJSON supports all the GeoJSON shapes; Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon and GeometryCollection.

 

Thanks to Colin Brown for giving it a quick test and talking me into putting it on CodePlex.

 

Project Hush Hush

September 8th, 2008

I came up with a lightening bolt of an idea the other week while I was thinking of a small project to do to try out some new technology. This project has spiraled into a bigger project which I think could be quite cool and big - so there goes my evenings for the next few months.

The few people I’ve told the idea to seem to think it also sounds good, either that or they’re just humouring me so I waste my time on it. Either way it’s giving me a great chance to try out some technologies that interest me.

Hopefully it will encourage me to blog more, I’ll be sharing bits and pieces as I go along.

I discovered a free Subversion source control provider (assembla) so all my work is safely backed up remotely (maybe I should use the project management tools to keep a track of ideas). Ideally I’d like to do host the source control myself, only currently I can’t afford to change (or find one that matches (will match) my needs) hosting provider to a Virtual Private Server.

System.Data.SqlClient.SqlException: Login failed for user

August 30th, 2008

I’ve had this exception happen to me so many times in the past but I’m always forgetting what the solution is. It ends up I keep forgetting to have "SQL Server and Windows Authentication mode" selected in the properties window for the database server.

serverproperties

My programming history

August 27th, 2008

Thanks to Scott for making me do this :@

1. How old were you when you started programming?

I started messing about with Q Basic back when I was about 14 but never wrote anything ‘proper’ until I started college at 16.

2. How did you get started in programming?

My dad was one of those bedroom coders when I as little (he actually wrote a cool piece of software that was in use for over 10 years and saw life on the ZX-Spectrum, Amiga and PC). I picked up one of his books and had the intention of writing something cool….it ended up just being ‘hello world!’.

3. What was your first language?

Q Basic, followed by Pascal at college and Delphi. I messed around with HTML and made a few dodgy websites that I think still exist to this day somewhere. [edited - Luke's RCT Site]

4. What was the first real program that you wrote?

My A’ Level coursework, a friend of mine had a virtual airline (Microsoft flight simulator geekiness) and he wanted a program to manage his pilots ours and generate html reports for his website. What took me months in Delphi I could now knock together in a matter of days. Oh yea I didn’t use a database either, stored everything in random access files….ergh!

5. What languages have you used since you started programming?

HTML, JavaScript, C, Java, C#, ASP,C++,TCL (I loved that), T-SQL,Basic,Pascal,O-Caml, Matlab, XML,Delphi

6. What was your first programming gig?

I freelanced when I was about 16 doing HTML for some company who’d designed the website. I did everything with tables,yuck.

7. If you knew then what you know now, would you have started programming?

Yea. Its fun when you have a challenge. Though I still hate T-SQL…I love you LINQ.

8. If there is one thing you learned along the way that you would tell new developers, what would it be?

As Scott has said Google (and soon stackoverflow) is your friend.

 

And I tag Chris Forster, Rob Ashton and Philip Stears!

Iceland Road Trip

August 8th, 2008

I recently went to sunny Iceland, almost 24 hours sunlight is quite weird. Rather than staying in Reykjavik for the whole week we rented a car and road tripped around the ring road, staying in campsites. If you ever go to Iceland I recommend doing this, you get to see so much more without having to worry about getting back to your hotel each night (camping during the winter though may be a bit cold). And how often can you say you’ve camped at the foot of a Glacier?

Below is a photo I took of Strokkur Geyser, which is next to the original Geysir.

Strokkur Geyser

Sometimes you have to catch an exception

July 31st, 2008

I had a comment left recently on a post I made a few months ago (HttpRequest QueryValue extension methods), I was going to reply in the comments but felt it deemed a post in itself.

I agree 100% with the commenter about avoiding throwing exceptions and I try to always use the Tester-Doer pattern. As you can see in the code in the post I am using this pattern.

However the ConvertFromInvariantString method will throw an exception in cases where ‘asdf’ is trying to be converter to an int, and at the time I couldn’t find a way to do something similar to a TryParse with a TypeConverter. The IsValid method exists but this always returns true and Microsoft have said they won’t fix it. So using a TypeConverter as above you are required to catch an exception (sucks doesn’t it?).

The IsValid Documentation states ‘You can write your own WillConvertSuceed method by wrapping the ConvertTo and ConvertFrom methods in exception blocks.’.

If anyone knows of a way around having to catch an exception when using a TypeConverter please send me a message or leave a comment.

HttpRequest QueryValue extension methods

May 17th, 2008

Getting non string values from the querystring can be a chore if you need to read alot of values; parsing to the required type and ensuring the querystring value doesn’t cause an exception ("adsf" cannot become an integer) can add alot of code to each page. So a long while ago I created a small helper class to do this for me, which I’ve now upgraded (after reading a blog entry by ScottH about TypeConverters) to use generics and extension methods. I’ve also included methods to get a value from the Request.Form property.

using System;
using System.Web;
using System.ComponentModel;

namespace LukeSmith.Web
{
    public static class HttpRequestHelper
    {
        public static T? GetQueryValue<T>(this HttpRequest request, string name)
            where T : struct
        {
            return ConvertFromString<T>(request.QueryString[name]);
        }

        public static T? GetQueryValue<T>(this HttpRequest request, int index)
            where T : struct
        {
            return ConvertFromString<T>(request.QueryString[index]);
        }

        public static T? GetFormValue<T>(this HttpRequest request, string name)
            where T : struct
        {
            return ConvertFromString<T>(request.Form[name]);
        }

        public static T? GetFormValue<T>(this HttpRequest request, int index)
            where T : struct
        {
            return ConvertFromString<T>(request.Form[index]);
        }

        private static T? ConvertFromString<T>(string value)
            where T : struct
        {
            T? result = null;

            if (!string.IsNullOrEmpty(value))
            {
                TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));

                if (converter.CanConvertFrom(typeof(string)))
                {
                    try
                    {
                        object obj = converter.ConvertFromInvariantString(value);
                        result = (T)obj;
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            return result;
        }
    }
}

Updated: Why Try/Catch was used

Get meshed up

April 26th, 2008

If you follow Microsoft technology, then unless you’ve been hidden under a rock for the past week or two, you’ve probably heard of Live Mesh. ScottIsAFool sent me an invite the other day so I’ve got it in. If you’d like to get in then checkout ShareMesh, it’s an invite sharing site since every Mesh user gets 2 invites.

What is Mesh?

Mesh is a platform for making your data available across all your devices; whether it’s your Desktop, Laptop, Mac or Mobile (coming soon). The Mesh application allows you to share folders and files on your machine across all your devices and the Mesh Live Desktop, as well as with friends, and Mesh keeps everything synched.

LiveSide have all the information you need.

Videos

Technorati Tags:

Send to Nabaztag IE Extension

April 23rd, 2008

If you’re a long term blog reader of mine then you’d know I have one of those pointlessly cool WiFi Nabaztag rabbits. It usually just sits on my shelf doing nothing, but I’ve now decided to use it as a podcast player. I created a simple and quick IE Extension to be able to send links (the rabbit will only play mp3’s) to the Nabaztag Api.

If you have a Nabaztag and you too want to send URLs from IE to be played on your pointlessly cool rabbit as well then follow the instructions:

  1. Download and extract the SendToNabaztagIEExtension zip to somewhere on your machine.
  2. Right click on IEExtension.reg and select edit.
  3. Modify the directory of IEExtension.html and save.
  4. Double click IEExtension.reg to install the registry settings. (note: usual blurb about the dangers of editing the registry)
  5. Edit IEExtension.html and enter the token and serial number for your rabbit. These can be found under the "my Burrow" section of the Nabaztag website.
  6. Close any instances of IE.

Next time you open IE, when right clicking on a hyperlink you will see an option ‘Send to Nabaztag’. Clicking this will send the link to your bunny (note: the url is sent regardless of whether the rabbit can actually play it).

sendtonabaztag

Notes: A new window is opened to make the request, which will show the response from the NabaztagApi. I tried using XmlHttpRequest but was unable to because of the cross-domain call being made. It was only quickly put together, so use at your own risk!

Technorati Tags: