Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown when downloading the file form sharepoint document library

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown when downloading the file form sharepoint document library

Scheduled Pinned Locked Moved SharePoint
csharpsharepointsysadmindata-structuresquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sudhanshu Mani Tripathi
    wrote on last edited by
    #1

    Hi, I am using copy service(copy.asmx) to download the files from sharepoint document library. In sharepoint server, I have created a doument library and this library contain serveral folders , i have to downlaod the files from document library folder but when i call the GetItem() method of copy service then throw exception SoapServerException . I am using following code to download the file. // sharepoint is a web reference that points to http://sharepoint/\_vti\_bin/copy Copy myCopyService = new Copy(); myCopyService.Url = url + "/_vti_bin/copy.asmx"; myCopyService.PreAuthenticate = true; myCopyService.Credentials = new System.Net.NetworkCredential("Administrator", "Path1234", "e1srv245"); // URL to the file you want to downlaod string copySource = url + "/PaymentAttachment/105/"+ fileName; //HtmlAnchor anchor = new HtmlAnchor(); //anchor.Target = "_blank"; //anchor.HRef = copySource; // Define the variables that will store the output from the web service call FieldInformation myFieldInfo = new FieldInformation(); FieldInformation[] myFieldInfoArray = { myFieldInfo }; byte[] myByteArray; // Call the web service uint myGetUint = myCopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray); // Convert into Base64 String string base64String; base64String = Convert.ToBase64String(myByteArray, 0, myByteArray.Length); // Convert to binary array byte[] binaryData = Convert.FromBase64String(base64String); // Create a temporary file to write the text of the form to string tempFileName = Path.GetTempPath() + "\\" + myFieldInfoArray[0].Value; // Write the file to temp folder FileStream fs = new FileStream(tempFileName, FileMode.CreateNew, FileAccess.ReadWrite); fs.Write(binaryData, 0, binaryData.Length); fs.Close(); I am not identifying, what i am missing?

    S 1 Reply Last reply
    0
    • S Sudhanshu Mani Tripathi

      Hi, I am using copy service(copy.asmx) to download the files from sharepoint document library. In sharepoint server, I have created a doument library and this library contain serveral folders , i have to downlaod the files from document library folder but when i call the GetItem() method of copy service then throw exception SoapServerException . I am using following code to download the file. // sharepoint is a web reference that points to http://sharepoint/\_vti\_bin/copy Copy myCopyService = new Copy(); myCopyService.Url = url + "/_vti_bin/copy.asmx"; myCopyService.PreAuthenticate = true; myCopyService.Credentials = new System.Net.NetworkCredential("Administrator", "Path1234", "e1srv245"); // URL to the file you want to downlaod string copySource = url + "/PaymentAttachment/105/"+ fileName; //HtmlAnchor anchor = new HtmlAnchor(); //anchor.Target = "_blank"; //anchor.HRef = copySource; // Define the variables that will store the output from the web service call FieldInformation myFieldInfo = new FieldInformation(); FieldInformation[] myFieldInfoArray = { myFieldInfo }; byte[] myByteArray; // Call the web service uint myGetUint = myCopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray); // Convert into Base64 String string base64String; base64String = Convert.ToBase64String(myByteArray, 0, myByteArray.Length); // Convert to binary array byte[] binaryData = Convert.FromBase64String(base64String); // Create a temporary file to write the text of the form to string tempFileName = Path.GetTempPath() + "\\" + myFieldInfoArray[0].Value; // Write the file to temp folder FileStream fs = new FileStream(tempFileName, FileMode.CreateNew, FileAccess.ReadWrite); fs.Write(binaryData, 0, binaryData.Length); fs.Close(); I am not identifying, what i am missing?

      S Offline
      S Offline
      ssivarao
      wrote on last edited by
      #2

      Hello Sudhanshu Mani Tripathi, Check whether the webservice "/_vti_bin/copy.asmx" is active or out and do the following steps again

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups