0

I am using the "Copy" web service to attempt to upload a document to an SP2010 website. However, when I execute the "CopyIntoItems" method, I receive a WebException (details below). I'm following the general approach suggested in this post: Simplest way to Upload a document to sharepoint using web services.

Any suggestions?

System.Net.WebException was unhandled
  Message="The request failed with the error message:\r\n--\r\n<html><head><title>Object moved</title></head><body>\r\n<h2>Object moved to <a href=\"%2f_login%2fdefault.aspx%3fReturnUrl%3d%252fsites%252fnn%252f_vti_bin%252fcopy.asmx\">here</a>.</h2>\r\n</body></html>\r\n\r\n--."
  Source="System.Web.Services"
  StackTrace:
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
Community
  • 1
  • 1
Jeremy
  • 9,023
  • 20
  • 57
  • 69

1 Answers1

1

You might be referring incorrect asmx URL, check here http://www.landofsharepoint.com/2009/08/error-when-trying-to-reference-custom.html

Also, what is the authentication of site ? NTLM or FBA ?

Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124
  • The URL I'm using opens correctly in a browser. The site is using FBA against Active Directory. – Jeremy Dec 01 '10 at 17:52
  • 1
    FBA is problem. If you see error, it is redirecting you to login page. You will need to hit webservice to site accepting NTLM credentials. You can extend your site to another zone accepting NTLM. – Madhur Ahuja Dec 01 '10 at 17:54
  • Ah ha. Yes, that does ring a bell a bit from when I worked in 2007. I will give that a shot and update this post accordingly. – Jeremy Dec 01 '10 at 18:00