因此,我们需要使用iOS客户端将文件上传到sharepoint服务器。我们可以上传到40 it,但问题是我们传递的文件数据是Base64编码,而大于40 it的文件由于不能在soap消息中传递大数据而失败,所以我们尝试了不同的方法,并在web上提到了。这是我们尝试过的方法
我们只能使用MTOM发送数据。
经过大量的实验和搜索,我认为MTOM是一种使用soap上传数据的方法。我们使用CopyIntoItems sharepoint服务进行上载。
Soap请求看起来像
<"xmlns:soap12=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap12:Body>\n"
"<CopyIntoItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">\n"
"<SourceUrl>%@</SourceUrl>\n"
"<DestinationUrls>\n"
"<string>%@</string>\n"
"</DestinationUrls>\n"
"<Fields>\n"
"%@"
"</Fields>\n"
"<Stream>MY_FILE_DATA</Stream>\n"
"</CopyIntoItems>\n"
"</soap12:Body>\n"
"</soap12:Envelope>\n"现在的问题是如何以MTOM接受的方式格式化这个soap请求,因为CopyIntoItems可能无法在其他格式中工作。
我查过的少数几个MTOM样本
soapmtom.html
http://cxf.apache.org/docs/mtom.html
任何帮助都是appreciated..Thanks!
发布于 2013-12-03 15:39:51
如何使用HTTP和开发一个Http处理程序来存储已发布的数据?
在Sharepoint (MSDN)中设置http处理程序非常容易,在流程请求方法中,您可以使用查询字符串来获取所需的信息。假设您创建了一个Upload.ashx处理程序。
public void ProcessRequest(HttpContext context)
{
var targetList = context.Request["targetList"];
var targetFileName = context.Request["targetFn"];
// Get the stream to content
var stream = context.Request.GetBufferedInputStream();
// Save the file somewhere
}从客户端向http://server/_layouts/15/Upload.ashx?targetList=myFiles&...发送HTTP
https://stackoverflow.com/questions/20355124
复制相似问题