1

I am trying to upload content to SharePoint site using its Copy.asmx web service's CopyIntoItems operation from one of my iPhone applications.

Here is the sample xml That I am trying to POST.

<?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>mytestsite/Upload Library/Check_File_Upload.txt</string></DestinationUrls><Fields><FieldInformation Type="File" DisplayName="Name" InternalName="FileLeafRef" Value="Check_File_Upload.txt" /><FieldInformation Type="Guid" DisplayName="GUID" InternalName="GUID" Value="{21026DFC-E19E-470E-8B1D-7D7C5FA84FF3}" /></Fields><Stream>VGhpcyBpcyBhIHRlc3QgZmlsZSB0byBjaGVjayB1cGxvYWQgZnVuY3Rpb25hbGl0eS4gYW5kIGNoZWNraW5nIGFnYWluLg==</Stream></CopyIntoItems>
</soap:Body>
</soap:Envelope>

Can anyone help me to figure out the issue?

1 Answers1

0

I'm was able to do it with Java. See this thread

Gettting 400 Bad Request while uploading file to SharePoint 2010 using Copy.CopyIntoItems web service

Hope this helps.

Also here are some very useful field type that I've compiled. I'm using SharePoint 2010

Choice List

fieldInfo.setDisplayName("Day Of Week");
fieldInfo.setType(FieldType.CHOICE);
fieldInfo.setValue("Friday"); 

Multi Choice List, note that each value is separated by ;#

fieldInfo.setDisplayName("Hobbies");
fieldInfo.setType(FieldType.MULTI_CHOICE);
fieldInfo.setValue("Biking;#Reading"); 

Enterprise Keywords,

fieldInfo.setDisplayName("Enterprise Keywords");
fieldInfo.setType(FieldType.NOTE);
fieldInfo.setValue("-1;#wind;#-1;#turbine"); 

Managed Metadata. Important, note that the displayname must be append to “_0” and the value must be in the format of -1#SomeValue|guid as shown below

fieldInfo.setDisplayName("MyMetadata_0");
fieldInfo.setType(FieldType.NOTE);
fieldInfo.setValue("-1;#wind|4c29faf0-bea6-4032-893f-d5aaea458728;#-1;#turbine|6e552448-77d1-4349-bc11-52debdcbc860"); 

Content Type. You can get the Id of the content type by viewing on the content type properties and note the id in the url, something like. Get the value of the param, ctype https://eimsscnqa.sandia.gov/sites/DocLib026/_layouts/ManageContentType.aspx?ctype=0x0101005C02449B3F60DF42A78192F51AAD4A5202e

fieldInfo.setDisplayName("Content Type Id");
fieldInfo.setType(FieldType.TEXT);
fieldInfo.setValue("0x0101005C02449B3F60DF42A78192F51AAD4A5202e");
Community
  • 1
  • 1
duvo
  • 1,634
  • 2
  • 18
  • 30