none
Exchange Online web services, cannot get it working... RRS feed

Answers

  • Its seems like you didn't quite understand what i was trying to say.

    The domain in the network credential overload is referring to the active directory domain which in the case of BPOS is the domain the BPOS Exchange server is hosted in it looks like you confusing this with your email or local AD domain which have nothing to do with this unless you federating your security with BPOS so that fact you keep trying to use a domain means your always sending invalid credentials. What you should use is

    binding.Credentials = new NetworkCredential( "myInitials@ourDomain.dk","password,"");

    don't use anything is the domain field and try that which should work

    Cheers
    Glen

     

    • Marked as answer by Aidal Tuesday, February 15, 2011 8:57 AM
    Tuesday, February 15, 2011 2:12 AM

All replies

  • I don't really have an answer, but I notice that there is a 400 error at the end of the output you posted.  That often means that a request is being picked up by the wrong site on the server.  Maybe the site you have EWS on (probably the Default Web Site) is configured to listen on a specific IP address (rather than All Unassigned), or it has a Host Header name configured?
    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Monday, February 7, 2011 3:03 PM
  • If you want to use Autodiscover with BPOS then you need to make sure your DNS is setup which involves setting up a CNAME as per http://www.microsoft.com/online/help/en-us/helphowto/6a984970-1606-480f-92e2-585ff1ddae84.htm

    But basically in regards to EWS with BPOS you only get one of 3 urls returned depending on your location which you can use directly instead or using autodiscover defined in http://technet.microsoft.com/en-us/library/cc745934.aspx to access EWS you just tack on EWS/Exchange.asmx

    eg  https://red001.mail.microsoftonline.com/ews/exchange.asmx

    Cheers
    Glen

     

    Tuesday, February 8, 2011 1:42 AM
  • This isn't our server, it is Exchange Online hosted by Microsoft.
    Tuesday, February 8, 2011 7:52 AM
  • I'm using

    https://red002.mail.emea.microsoftonline.com/ews/exchange.asmx although if i make a reference to this URL in my project it will get changed into https://red002.mail.emea.microsoftonline.com/ews/services.wsdl in Vistal Studio.

    Inside my code I use the first one though.

    Tuesday, February 8, 2011 10:59 AM
  • You use the .wsdl for your project references.  You POST your requests to (or bind to) the .asmx URL.
    Outlook Web Access For PDA , OWA For WAP
    www.owa-pda.com
    email a@t leederbyshire d.0.t c.0.m
    Tuesday, February 8, 2011 1:31 PM
  • Exactly, and it is not working for me. Erros shown in my initial post.

    If anyone know of a good resource for simple getting started samples it would be much appreciated, since I cannot get the official sampes to work.
    Wednesday, February 9, 2011 8:29 AM
  • Those errors indicate you haven't setup your DNS to work with BPOS the Outlook clients can work around this because the signin client makes local modifications to work around this. As i suggested before you don't really need to use autodiscover so comment out that line and use instead

    Server.url = new uri("https://red002.mail.emea.microsoftonline.com/ews/exchange.asmx")

    If you have problem with your code you should also post the code your using not just the error.

    Cheers
    Glen

    Wednesday, February 9, 2011 9:13 AM
  • Ok, I'm gonna forget all about SDK sample applications and autodiscovery.

    I've made this little simple console application which gives me the error "The request failed with HTTP status 401: Unauthorized."

    ------------------
    using TestApp2.ExchangeWebServices; // this is the web reference 

    static void Main(string[] args)
    {
    FindExample();
    Console.WriteLine();
    Console.WriteLine("Prgram has ended. Press any key to exit...");
    Console.Read();
    }

    public static void FindExample()
    {
    string usr1 = "<my_email_address>";
    string pwd1 = "<my_password>";
    string domain1 = "<our_domain>";

    ExchangeServiceBinding binding = new ExchangeServiceBinding();
    binding.Credentials = new NetworkCredential(usr1, pwd1, domain1);
    binding.Url = @https://red002.mail.emea.microsoftonline.com/ews/Exchange.asmx;

    FindItemType request = new FindItemType();
    request.ItemShape = new ItemResponseShapeType();
    request.ItemShape.BaseShape = DefaultShapeNamesType.Default;
    request.Traversal = ItemQueryTraversalType.Shallow;
    request.ParentFolderIds = new BaseFolderIdType[1]; 

    request.ParentFolderIds[0] = inbox;

    DistinguishedFolderIdType inbox = new DistinguishedFolderIdType();
    inbox.Id = DistinguishedFolderIdNameType.inbox;   
     

    FindItemResponseType response = binding.FindItem(request);
    }
    ------------------

    PS. My account is also registered as administrator in our solution or portal. 

     

     

    Wednesday, February 9, 2011 11:06 AM
  • Access denied could mean a number of things first does the administrative user have a mailbox can you logon to OWA as this user eg try the BPOS OWA url link https://red002.mail.emea.microsoftonline.com/owa/auth/logon.asp and take note of the username and password you need to logon to this. Take those same credentials and try these (the domain in Bpos should be left blank essentially your using the UPN so the domain in redundant). You may also want to consider using the EWS Managed API which will is a lot easier to code with then using proxy code.

    Cheers
    Glen

     

     

    Thursday, February 10, 2011 2:27 AM
  • https://red002.mail.emea.microsoftonline.com/owa/ I can log in yes, I do this when reading mails when i'm away from my laptop.

    These credidentials are the same as I use in the code posted, although I do provide domain as well, could that alone break it?

    I did try the EWS API 1.1 but I didn't quite get the part where you validate the certificate and there weren't really any examples shown for how to do this exactly, so I went with the proxy approach since I'm very used to working with web services in the first place. 

    Thursday, February 10, 2011 12:19 PM
  • >>  These credidentials are the same as I use in the code posted, although I do provide domain as well, could that alone break it?

    Yes if the domain isn't correct what are you trying to use as the domain ?, Did you try it using just use the UPN and password ?

    Cheers
    Glen

    Friday, February 11, 2011 12:15 AM

  • Well obviously I'm not going to post my cridentials here but the mask is  as follows.

    string usr1 = "myInitials@ourDomain.dk";
    string pwd1 = "myPassword";
    string domain1 = "ourDomain.dk"; // I have tried without ".dk" as well, makes no difference.

    myInitials@ourDomain.dk / myPassword is what I would use when logging into the Access Web Client or the Microsoft Online Services - SignIn application used by Outlook to connect to Exchange Online.

    Monday, February 14, 2011 3:42 PM
  • Its seems like you didn't quite understand what i was trying to say.

    The domain in the network credential overload is referring to the active directory domain which in the case of BPOS is the domain the BPOS Exchange server is hosted in it looks like you confusing this with your email or local AD domain which have nothing to do with this unless you federating your security with BPOS so that fact you keep trying to use a domain means your always sending invalid credentials. What you should use is

    binding.Credentials = new NetworkCredential( "myInitials@ourDomain.dk","password,"");

    don't use anything is the domain field and try that which should work

    Cheers
    Glen

     

    • Marked as answer by Aidal Tuesday, February 15, 2011 8:57 AM
    Tuesday, February 15, 2011 2:12 AM
  • Yes, no I didn't understand what you meant, which is why a sample tells so much more than what you can say with words, and why I was searching for code samples in the first place.
    Your single line of code leaves no room for misinterpretation in any way regardless of what any text around it might say.

    Anyway, I'm getting past my error now, so now I just need to figure out how to do the standard tasks like, read the inbox, check calendar (shared as well) and stuff like that.

    I'll search for some samples on how to do that. Thanks.
    Tuesday, February 15, 2011 8:57 AM