System Center Service Manager and Windows Phone? Why not?

Last week I was presenting at Microsoft’s conference in Portorož, Slovenia. The theme of the presentation was extending and customizing System Center Service Manager. One of the tings I talked about was Service Manager SDK, so this was a chance for a really cool demo, since when programing comes into play, everything is possible. So I thought to myself, what could possibly be more fun than approving a change request created in Service Manager on Windows Phone 7.

This is actually easier said than done. The first thing that was pretty obvious, was that there is no way that I can convince Windows Phone 7 to talk directly to Service Manager. Even if that were possible, how could I securely publish Service Manager out in the wild, to access it with phone over the internet. So the obvious thing was, that I needed to create a kind of http service, that will talk to Service Manager, and Windows phone will talk to that service.

Windows Communication Foundation was kind of obvious choice for my solution. I’ve created a service with two functions, one to get all the change requests, that logged in user have to review and other one to approve or reject specific change request. The whole project is attached to this post, so you can download it and see the code. The thing is really pretty simple. Once I had the service, I just had to publish it out in the internet to access it with Windows Phone. I have Forefront TMG in my environment so this was a piece of cake.

In order for service to access Service Manager, end user have to authenticate himself in some way.  Well the best thing would be to use windows authentication, but unfortunately Windows Phone doesn’t support it. And, guess what? WCF implementation in Windows Phone doesn’t support http basic authentication either. However, basic authentication is in fact really basic. It is just an “Authorization” header which is added to the HTTP call which contains the base64 encoded user name and password. So I managed to resolve this issue using OperationContext. Windows Phone application project is also attached to this post so you can get the idea of what I’m talking about.

That’s it for today. If you have any questions about the source code or anything else, you can send me an e-mail. You can find the address in the about page.

Leave a Reply