Collaborate without boundaries

Re: How to connect to Excel Service in SharePoint online

How to connect to Excel Service in SharePoint online

  • This post has 8 Replies |
  • 4 Followers
  • Hi,

     

    I am not able to connect to ExcelService hosted in SharePoint online.

     

     using (ES.ExcelServiceSoapClient excelService = new ES.ExcelServiceSoapClient())
                {
                    excelService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
                    excelService.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("username","password");

     

    }

     

    This is keep giving me this error

    Unhandled Exception: System.ServiceModel.ServerTooBusyException: The HTTP servic
    e located at http://automate.sharepoint.com/_vti_bin/ExcelService.asmx is too bu
    sy.  ---> System.Net.WebException: The remote server returned an error: (503) Server Unavailable.

     

     

    I have found out that in order to connect to SharePoint online I have to add two cookies to each request. Looks like same thing has to be done with ExcelService but the proxy generated by VS 2010 for the ExcelService.asmx the class ExcelServiceSoapClient  does not contain any CookieManager.


  • Hi Ronak,

    Here's some development links that I've found that may help point you towards a solution:

    www.microsoft.com/.../details.aspx

    msdn.microsoft.com/.../Office365TrainingCourse

    msdn.microsoft.com/.../hh147180.aspx

    msdn.microsoft.com/.../ee335711.aspx

    blogs.msdn.com/.../a-lap-around-sharepoint-2010-sandboxed-solutions-resource-quotas.aspx

    msdn.microsoft.com/.../sharepoint

    msdn.microsoft.com/.../hh147177.aspx

  • Did you have any further questions regarding this issue Ronak?

  • Hi Mike,

    I went through all those vidoes and help documentation. All of them point to SharePoint 2010 local install. Adding a Service Reference of the ExcelService.asmx for the SharePoint 2010 locally installed version does create a necessary proxy classes and I was able to connect to it very fine. Here is the code that works for SharePoint 2010 local version. I tried all the different ways to connect to SharePoint Online ExcelService , but looks like there is no way.

    private static void SharePoint2010()

           {

               BasicHttpBinding httpBinding = new BasicHttpBinding();

               httpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;

               httpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;

               httpBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;

               string excelServiceUrl = @"http://devsp10/my/personal/dev/_vti_bin/ExcelService.asmx";

               EndpointAddress endpointAddress = new EndpointAddress(excelServiceUrl);

               using (ES.ExcelServiceSoapClient excelService = new ES.ExcelServiceSoapClient(httpBinding, endpointAddress))

               {

                   excelService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

                   excelService.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("user", "pass", "domain");

                   ES.Status[] stati;

                   string sessionId = excelService.OpenWorkbook(@"http://devsp10/my/personal/dev/Shared%20Documents/ron.xlsx", "en-US", "en-US", out stati);

                   object o = excelService.GetCellA1(sessionId,

                          "Sheet1",

                          "A3",

                          true,

                          out stati);

                   Console.WriteLine(o.ToString());

                   excelService.CloseWorkbook(sessionId);

               }

           }

  • Hi Ronak,

    If you're unable to connect to the Online version of it, it would be due to security restrictions on the environment (since the Service itself would be running from the Hosted area of the Site).

    I would agree with you that, at this time, there is not a solution for this to be deployed.

  • Hello

    there is NO Excel services available on SharePoint Online

    so you won't be able to do what your want

    Benoit HAMET

    Senior Solutions Architect

    MVP SharePoint - MCITP Office 365

    Blog - Twitter

  • Did you have any further questions regarding this issue Ronak?

  • Hi Mike,

    I still don't know why you guys are saying that Excel Service are not exposed.

    automate.sharepoint.com/.../ExcelService.asmx

    Here is the service hosted by Office 365 under my SharePoint site, I can Add Service Reference to this Web Service using VS 2010. It does create a necessary proxy classes. The Question is how do i pass my windows live account id and password that I use to connect to SharePoint online via Web Browser to this proxy class, so I can create, delete, update excel file(s) stored under Documents (Library) in SharePoint.

  • Unless you have the enterprise plan, with E3 it is available.

    Hope this helps

     

    Robert

     

Page 1 of 1 (9 items)