The main problem is how to perform an upload programmatically to Sharepoint
2003 from an external application. Three approaches have been tested with
their respective problems:
- AddAttachment web service. There's no way to get the ListItemId associated
to the item to upload, there's always error telling something like
"ListItemId does not exists, or does not belong to valid item". For
instance, this error occurs when using the ID of the "Document Library"
(obtained through the GetLists web service).
- Forging a raw upload submit as a www-form-encoded message, and sending it
through the .Net framework's HttpWebRequest object. The response page is an
empty one, and the files doesn't enter the document library.
- Using the OO SharePoint platform. Modifying the web.config to add the
Sharepoint assembly, and instancing a SPWeb object as new Site(...).OpenWeb,
and attempting to do an upload through SPWeb.Files.Add(...). The problem
here occurs when accessing any property/method of the instanced SPWeb object
causes an exception (...Interop...: Cannot perform operation, or something
similar).
Background:
- The external application is an asp.net script, running in a different web
site from the SharePoint one.
- This asp.net application runs with an application pool with the same
user/password/domain as the SharePoint administrator.
- In the 1st and 2nd approaches, credentials are sent (user/password/domain
of the SharePoint admin) at the http messaging level, to avoid problems
related to authentication/authorization.
- All SOAP messages are well-formed (tested through XMLSpy).
Any help will be appreciated
Regards,
Claudio Gandolfo
Leer las respuestas