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.
this works (almost to full content) for Link-lists and Discussions, but I can't get it to work for Picture or Document libraries ...
for reference here is the xml-body of my HTTP SOAP Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY" xmlns:soap12="http://ift.tt/18hkEkn">
<soap12:Body>
<AddWebPartToZone xmlns="http://ift.tt/tz2xBC">
<pageUrl>/sites/ideas4u/Pages/abcxyz.aspx</pageUrl>
<webPartXml>
<?xml version="1.0" encoding="utf-8" ?>
<webParts>
<webPart xmlns="http://ift.tt/1CAxerD;
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="ListUrl" type="string">/sites/ideas4u/Lists/MyList</property>
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
</properties>
</data>
</webPart>
</webParts>
</webPartXml>
<storage>Shared</storage>
<zoneId>Zone 2</zoneId>
<zoneIndex>1</zoneIndex>
</AddWebPartToZone>
</soap12:Body>
</soap12:Envelope>
ie. when "MyList" (given in ListUrl property) is a document or picture library, I always get the following error response when submitting the request:
Do you have an idea as to why it is not working this way? Am I missing something? Thanks for any help!
0 commentaires:
Enregistrer un commentaire