我试图通过我正在编写的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