locked
using EWS Managed API to verify a person against company's Outlook GAL RRS feed

  • Question

  • i am tring to create a COM+ component inherited from ServicedComponent class and using EWS API to verify if a person is existing in our company's Outlook GAL.
    when I implement IsOurEmail() function shown below directly in Console application, it works. but we I put it into a COM+ component and call this function from a console app, there is an error occurred:
    "System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type 'Microsoft.Exchange.WebServices.Data.ServiceResponseException' was not found."

    I found it caused by NameResolutionCollection. do you know how to fix it?


    Transaction(TransactionOption.Required)]
    public class MyExchange : ServicedComponent
    {
     ...
     
    [AutoComplete(true)]
            public Boolean IsOurEmail(ref string strSurName,
                                       ref string strGivenName)
            {
                Boolean blnReturnValue = false;

                ExchangeService m_service = OpenSession();
                NameResolutionCollection nameResolutions;

                strGivenName = strGivenName.Trim() + " ";

               nameResolutions = m_service.ResolveName(
                                                    strSurName,
                                                    ResolveNameSearchLocation.DirectoryOnly,
                                                    false);
                
                ......

    • Moved by Mike Feng Friday, February 8, 2013 9:51 AM
    Thursday, February 7, 2013 10:23 PM

Answers

All replies

  • Deserialisation needs a public constructor without parameters.

    First the object is created, using parameterless constructor.

    Then the values are inserted (similar to how using object initiliasers work).

    At least that is what I learned about serialsiation when learnign a bit of WCF.

    Thursday, February 7, 2013 11:04 PM
  • Follow up questions should be asked in the Exchange Server 2013 - Development forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

    Wednesday, February 20, 2013 10:55 PM
  • Also, propably stupdi question:

    Why would you want to create a (unmanaged) COM Component in the Year 2013?

    Thanks to COM Interop you can use a .NET Component in COM (and Vice versa). Making it as .NET Component would have the advantage of fully trustable, managed code if you were to use it in .NET.

    COM is 20 Years old (older then Win 95) and .NET is for all purposes it's replacement. The COM support is only a bit of "Backwards Compatibility".


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2

    Thursday, February 21, 2013 10:36 AM
  • Yes. I am using .NET. servicedComponent is a .NET base class. I inherit my class from it in order to use COM+ services (instance management, transactions, synchronization...).

    Thursday, February 21, 2013 1:51 PM