0

I am trying to export excel file into share point server

I referred this link:Upload a file to SharePoint through the built-in web services.

I am unable to import Uri,SharePointserver2007,security etc... how can i import these?

public static void UploadFile2007(string destinationUrl, byte[] fileData)
{
    // List of desination Urls, Just one in this example.
    string[] destinationUrls = { Uri.EscapeUriString(destinationUrl) };

    // Empty Field Information. This can be populated but not for this example.
    SharePoint2007CopyService.FieldInformation information = new 
        SharePoint2007CopyService.FieldInformation();
    SharePoint2007CopyService.FieldInformation[] info = { information };

    // To receive the result Xml.
    SharePoint2007CopyService.CopyResult[] result;

    // Create the Copy web service instance configured from the web.config file.
    SharePoint2007CopyService.CopySoapClient
    CopyService2007 = new CopySoapClient("CopySoap");
    CopyService2007.ClientCredentials.Windows.ClientCredential = 
        CredentialCache.DefaultNetworkCredentials;
    CopyService2007.ClientCredentials.Windows.AllowedImpersonationLevel = 
        System.Security.Principal.TokenImpersonationLevel.Delegation;

    CopyService2007.CopyIntoItems(destinationUrl, destinationUrls, info, fileData, out result);

    if (result[0].ErrorCode != SharePoint2007CopyService.CopyErrorCode.Success)
    {
        // ...
    }
}
Community
  • 1
  • 1
  • This is just the code from the linked answer, copy+pasted here. What have you done to try to make it work? You need to demonstrate some amount of research and work on your own. – E-Riz Feb 10 '16 at 13:30
  • Thanks for the response .How can i import the above mentioned classes?is there any jar to that i can add ? – Sabiha Tasneem Feb 10 '16 at 13:40

0 Answers0