New Office Version – New Features – More Mobility

This weekend I got a little email from Microsoft containing the necessary details to download Office 2010 CTP. (I signed up almost two months ago at 
http://www.office2010themovie.com, and received an invitation code to use at http://connect.microsoft.com .) I obviously had to test it out on Windows 7.

Being Office it contains the usual suspects like Word and Excel with a more Win7 feel, but although I use some of these applications on a regular basis it was two other apps I was more interested in testing first; OneNote and Outlook.

OneNote is a neat program once you get used to it, but I’ve felt it to be lacking in some departments. The new version will sport a “cloud” option meaning that you can synchronize your workbooks to the cloud. So if you have multiple computers they will always be in sync with each other (and I really need that). And even better – OneNote Mobile will be able to hook up to the cloud too! Finally you can use it on your Windows Mobile without tethering! Alas, I was not able to test this at the moment for two reasons – it’s not enabled in this CTP, and the mobile version is not released yet. (The Windows Mobile 6.5 images contain OneNote 2007.)

Outlook was more test-friendly for my use at the moment. I know you folks out there with Lotus Notes/Domino will laugh, but there’s finally support for multiple Exchange accounts (from multiple domains if you so desire). So in the same Outlook you can have both your company Exchange mail, and your personal Exchange mail. (Even though you might not be running Exchange at home, maybe you’ve signed up to some hosted Exchange service.) For some silly reason you must add extra Exchange accounts from the Control Panel while Outlook is not running – let’s hope they change that before RTM.

But this wouldn’t be complete if I didn’t touch upon any mobile related stuff would it? I showed some screenshots a couple of months back regarding what’s coming in Exchange 2010, and naturally this means there will be more features in Outlook 2010 as well. Going into the “Options” you’ll find something similar to this:
image

Might not be that exciting, but could be practical for some people I guess. What’s better is that you can send text messages directly from Outlook too just like you would a new email. Now, I am aware that this is not new. This is available in Outlook 2007 as well, but since I’ve been using a plug-in provided by my mobile operator I haven’t taken the native support for a spin yet.

I tried to configure it natively since I assumed my plug-in might not be that happy about the 2010 version in a 64-bit variant.

Much to my dismay the wizard started out like this:
image

And guess what – pretty much any country and operator you choose you’re being told you need to sign up to “SMSOfficer” or some other service. And I don’t feel like signing up yet another account. (Just image this in an enterprise scenario.) Surely it must be possible to be your own provider…

Why yes it is, if you happen to be running Kannel! (You can’t have missed noticing me mentioning that product a few times in the past few months if you’ve visited this site.) Outlook does not talk directly to Kannel, but since Outlook Mobile Service, (or OMS for short), hasn’t changed much from Outlook 2007 it’s actually pretty well documented. The MSDN library is your friend: http://msdn.microsoft.com/en-us/library/bb277361.aspx

Building on the sample code provided I created a wrapper for Kannel. Basically you install a web service that Outlook can talk to, and this web service just relays the necessary bits to Kannel. I’m not going to bore you with all the details of setting this up, but you need to provide three methods:
– GetServiceInfo
– GetUserInfo
– DeliverXms

A bare minimum of code that will make this work:

using System.IO;
using System.Web.Services;
using System.Xml;
using System.Text;

namespace OMS
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://schemas.microsoft.com/office/Outlook/2006/OMS")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]

    public class Service1 : System.Web.Services.WebService
    {
        private const string m_sOmsNamespace = "http://schemas.microsoft.com/office/Outlook/2006/OMS";

        [WebMethod]
        public string GetServiceInfo()
        {
            StringWriter stringWriter = null;
            XmlTextWriter writer = null;
            try
            {
                stringWriter = new StringWriter(new StringBuilder());
                writer = new XmlTextWriter(stringWriter);

                writer.WriteStartElement("serviceInfo", m_sOmsNamespace);

                writer.WriteStartElement("serviceProvider");
                writer.WriteString("MobilityDojo.net");
                writer.WriteEndElement(); // </serviceProvider>

                writer.WriteStartElement("serviceUri");
                writer.WriteString("https://localhost/OMS/Service1.asmx");
                writer.WriteEndElement(); // </serviceUri>

                writer.WriteStartElement("localName");
                writer.WriteString("MobilityDojo.net");
                writer.WriteEndElement();

                writer.WriteStartElement("englishName");
                writer.WriteString("MobilityDojo.net");
                writer.WriteEndElement();

                writer.WriteStartElement("authenticationType");
                writer.WriteString("Other");
                writer.WriteEndElement();

                writer.WriteStartElement("supportedService");
                writer.WriteStartElement("SMS_SENDER");
                writer.WriteAttributeString("maxRecipientsPerMessage", "50");
                writer.WriteAttributeString("maxMessagesPerSend", "20");
                writer.WriteAttributeString("maxSbcsPerMessage", "140");
                writer.WriteAttributeString("maxDbcsPerMessage", "70");
                writer.WriteEndElement();
                writer.WriteEndElement();

                writer.WriteEndElement(); // </serviceInfo>

                return "<?xml version=\"1.0\" encoding=\"utf-16\" ?>"
                    + stringWriter.GetStringBuilder().ToString();
            }
            finally
            {
                if (writer != null)
                    writer.Close();

                if (stringWriter != null)
                    stringWriter.Close();
            }
        }

        [WebMethod]
        public string GetUserInfo(string xmsUser)
        {
           StringWriter stringWriter = null;
           XmlTextWriter writer = null;
           try
           {
              stringWriter = new StringWriter(new StringBuilder());
              writer = new XmlTextWriter(stringWriter);
              writer.WriteStartElement("userInfo");
              writer.WriteStartElement("replyPhone");
              writer.WriteString("12345678");
              writer.WriteEndElement(); // </replyPhone>
              writer.WriteStartElement("smtpAddress");
              writer.WriteString("user@domain.com");
              writer.WriteEndElement(); // </smtpAddress>
              writer.WriteStartElement("error");
              writer.WriteAttributeString("code", "ok"); // return "ok" if no errors
              writer.WriteEndElement(); // </error>
              writer.WriteEndElement(); // </userInfo>
              return stringWriter.GetStringBuilder().ToString();
           }
           finally
           {
              if (writer != null)
                 writer.Close();

              if (stringWriter != null)
                 stringWriter.Close();
           }
        }

        [WebMethod]
        public string DeliverXms(string xmsData)
        {
            return "";
        }
    }
}

Keep in mind, you’d probably want to do some user authentication as well, and configure the proper “replyPhone” number by doing an AD/LDAP lookup. The DeliverXms method doesn’t really do much at the moment, but you could get away with a HTTP GET to Kannel there if you like. Previous posts include the necessary code.

It seems you’ll get an error if you try to host the web service over plain HTTP, so you’ll need to enable SSL as well.

Type the details into the wizard:

image

Hit “More Settings”, and make sure you like what you see. (Note: if you can bring up this dialog box it means Outlook reached your web service.)

 image

Et voilà; create a new text message (don’t you love the preview pane, and how it resembles anything but a Windows Mobile device):

image

Microsoft doesn’t always get it right the way I define “right”, but you can do a lot by bringing your own utility belt to the table 🙂

I’ll keep playing with the CTP, and see if there’s more fun to be had. Windows 7 RTM hits TechNet/MSDN this week, and Windows Server 2008 R2 hits next week though, so I might have to do a couple of upgrades first mind you 🙂

4 thoughts on “New Office Version – New Features – More Mobility”

  1. Hi,

    Have built the service and works on our network, as soon as i try and send from a clients environment i get this error message back immediately, any idea as to whet it could be, they are using AD and Exchange:

    From: System Administrator
    Sent: 24 June 2010 09:30 AM
    To: +4797706660
    Subject: Undeliverable: Test message Collin Open Open-

    Your message did not reach some or all of the intended recipients.

    Subject: Test message Collin Open Open-
    Sent: 2010/06/24 09:30 AM

    The following recipient(s) cannot be reached:

    ‘+27836343888’ on 2010/06/24 09:30 AM

    Outlook did not receive response from the Web service because of a problem connecting to the server. Try again later.
    Server did not recognize the value of HTTP Header SOAPAction: http://schemas.microsoft.com/office/Outlook/2006/OMS/DeliverXms.

    ‘+27834140453’ on 2010/06/24 09:30 AM

    Outlook did not receive response from the Web service because of a problem connecting to the server. Try again later.
    Server did not recognize the value of HTTP Header SOAPAction: http://schemas.microsoft.com/office/Outlook/2006/OMS/DeliverXms

  2. Are you using the sample code as above, with a Kannel back-end or are there other differences? (I assume you’re not using an empty DeliverXms method as in my sample.) Which SMS provider are you using? Since I do most of my testing with the +47 prefix I’m guessing you’re trying to send from a Norwegian number, and +27 is South Africa – could there be a conflict here? Is it working when sending from +27 to +27, and the error just occurs when sending from +47 to +27?

  3. Hello,

    this is a great one, I am trying to work this out, but what if I want to authenticate user where this happens? what does the envelope look like that is sent as request to GetServiceInfo and GetUserInfo, where the authentication takes place?

  4. GetUserInfo is invoked when you configure the account in Outlook so this would be a natural place to include authentication. I do not know all the details of the xml sent to the web service, but if you check out http://msdn.microsoft.com/en-us/library/bb277361.aspx all the details should be there. I used that article as background for my code, and as far as I can see MSFT has expanded this article after I originally posted this.

Leave a Reply

Your email address will not be published. Required fields are marked *

*