我試圖通過我正在編寫的Mac應用程序以編程方式上傳文件到SharePoint。我可以使用GetListItems webservice來檢索文件列表,並且所有驗證等都可以正常工作。我自己形成SOAP消息如下:SharePoint CopyIntoItem目標C中的SOAP消息
起初我以爲我只是Objective C端寫錯了,但我一直在使用Firefox的'HTTP'請求擴展名,並且仍然無法獲得它工作。在海報,我構建
SOAP消息是:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CopyIntoItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<SourceUrl>http://null</SourceUrl>
<DestinationUrls>
<string>myurl.com/Shared Documents/Documents/TestingFile.txt</string>
</DestinationUrls>
<Stream>VGVzdGluZyB0ZXN0aW5n</Stream>
</CopyIntoItems>
</soap:Body>
</soap:Envelope>
流(目前)是隻是一些數據,看看我能得到它的工作。我讀過將SourceUrl設置爲http://null,可以在某些情況下提供幫助。我還讀了DestinationURL需要成爲完整路徑。這裏的問題是:
1)如果我把URL沒有https://開頭,然後我得到的迴應:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CopyIntoItemsResponse
xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<CopyIntoItemsResult>0</CopyIntoItemsResult><Results><CopyResult ErrorCode="Success"
DestinationUrl="myurl.com/Shared Documents/Documents/TestingFile.txt" /></Results>
</CopyIntoItemsResponse></soap:Body></soap:Envelope>
2)如果我把完整的路徑,例如
https://myurl.com/Shared Documents/Documents/TestingFile.txt
然後將結果告訴我,像以前一樣,除了這一點:
<CopyResult ErrorCode="Unknown" ErrorMessage="Object reference not set to an instance of an
object."
DestinationUrl="https://dbp.btfinancialgroup.com/Shared%20Documents/Papers/TestingFile.txt"
/>
3)如果我把完整的路徑,在引號,例如
「https://myurl.com/Shared文件/文件/ TestingFile.txt」
然後把結果告訴我同樣爲先,例如這是成功的,但 的這個DESTINATIONURL:
DestinationUrl=""https://dbp.btfinancialgroup.com/Shared
Documents/Papers/TestingFile.txt""
在所有這些情況下,該文件不會在目標的請求結束存在。
我真的陷入困境,因爲大多數在線建議都是爲了彌補C#問題,它們使用.net協議來連接到SharePoint。
有什麼建議嗎?
謝謝
您可以分享如何將文件從iOS上傳到SharePoint的obj-c源代碼?謝謝! – surlac