Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SOAP AddWebPart: XsltListViewWebPart for a Picture or Document Library

$
0
0

Hello everybody.

I am trying to add list webparts to a webpartpage via SOAP/REST.

I am using the AddWebPart or AddWebPartToZone Methods of the webpartpages.asmx Webservice like so:

<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><AddWebPartToZone xmlns="http://microsoft.com/sharepoint/webpartpages"><pageUrl>/sites/ideas4u/Pages/abcxyz.aspx</pageUrl><webPartXml>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;&lt;webParts&gt;&lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&gt;&lt;metaData&gt;&lt;type name=&quot;Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&gt;&lt;importErrorMessage&gt;Cannot import this Web Part.&lt;/importErrorMessage&gt;&lt;/metaData&gt;&lt;data&gt;&lt;properties&gt;&lt;property name=&quot;ListUrl&quot; type=&quot;string&quot;&gt;/sites/ideas4u/Lists/myVeryList&lt;/property&gt;&lt;property name=&quot;MissingAssembly&quot; type=&quot;string&quot;&gt;Cannot import this Web Part.&lt;/property&gt;&lt;/properties&gt;&lt;/data&gt;&lt;/webPart&gt;&lt;/webParts&gt;</webPartXml><storage>Shared</storage><zoneId>Zone 2</zoneId><zoneIndex>1</zoneIndex></AddWebPartToZone></soap12:Body></soap12:Envelope>

this works for Link-lists and Discussions, but I can't get it to work for Picture or Document libraries ...

ie. when myVeryList is a Picture Library or Document Library I get this error (which does not help at all):

soap:ReceiverException of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown: An error has occurred.

What am I doing wrong?
I simply need a way to add a document/picture library webpart to a webpartpage via SOAP or REST requests. (since I am developing an iOS-App).


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>