4.3.2.2 Update a Web Part

If the client needs to make updates to the Web Part, the client modifies the markup of the Web Part in memory, and then sends the SaveWebPart request to the server with the new markup and the recorded storageKey. The server commits the changes as requested and responds with the SaveWebPartResponse element.

A sample request is similar to the following:

 <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>
       <SaveWebPart2 xmlns="http://microsoft.com/sharepoint/webpartpages">
          <pageUrl>default.aspx</pageUrl>
          <storageKey>27b00113-ec28-4ee1-9d35-bc5bb645a7d0</storageKey>
          <webPartXml>
             &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;InitialAsyncDataFetch&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
             &lt;property name=&quot;ChromeType&quot; type=&quot;chrometype&quot;&gt;Default&lt;/property&gt;
             &lt;property name=&quot;Title&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;Height&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;CacheXslStorage&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;ListDisplayName&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
             &lt;property name=&quot;AllowZoneChange&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;AllowEdit&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;XmlDefinitionLink&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;DataFields&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;Hidden&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
             &lt;property name=&quot;ListName&quot; type=&quot;string&quot;&gt;{2843EA1B-EFE1-4FCC-A39B-A46121D3EFD6}&lt;/property&gt;
             &lt;property name=&quot;NoDefaultStyle&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
             &lt;property name=&quot;AutoRefresh&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
             &lt;property name=&quot;ViewFlag&quot; type=&quot;string&quot;&gt;8388745&lt;/property&gt;
             &lt;property name=&quot;Direction&quot; type=&quot;direction&quot;&gt;NotSet&lt;/property&gt;
             &lt;property name=&quot;AutoRefreshInterval&quot; type=&quot;int&quot;&gt;60&lt;/property&gt;
             &lt;property name=&quot;AllowConnect&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;Description&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;AllowClose&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;ShowWithSampleData&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
             &lt;property name=&quot;ParameterBindings&quot; type=&quot;string&quot;&gt;  &amp;lt;ParameterBinding Name=&quot;dvt_sortdir&quot; Location=&quot;Postback;Connection&quot;/&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;dvt_sortfield&quot; Location=&quot;Postback;Connection&quot;/&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;dvt_startposition&quot; Location=&quot;Postback&quot; DefaultValue=&quot;&quot;/&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;dvt_firstrow&quot; Location=&quot;Postback;Connection&quot;/&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;OpenMenuKeyAccessible&quot; Location=&quot;Resource(wss,OpenMenuKeyAccessible)&quot; /&amp;gt;
            &amp;lt;ParameterBinding Name=&quot;open_menu&quot; Location=&quot;Resource(wss,open_menu)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;select_deselect_all&quot; Location=&quot;Resource(wss,select_deselect_all)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;idPresEnabled&quot; Location=&quot;Resource(wss,idPresEnabled)&quot; /&amp;gt;&amp;lt;ParameterBinding Name=&quot;NoAnnouncements&quot; Location=&quot;Resource(wss,NoAnnouncements)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;NoAnnouncementsHowTo&quot; Location=&quot;Resource(wss,NoAnnouncementsHowTo)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;AddNewAnnouncement&quot; Location=&quot;Resource(wss,idHomePageNewAnnounce)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;MoreAnnouncements&quot; Location=&quot;Resource(wss,MoreAnnouncements)&quot; /&amp;gt;
             &amp;lt;ParameterBinding Name=&quot;ByText&quot; Location=&quot;Resource(wss,2000)&quot; /&amp;gt;&lt;/property&gt;
             &lt;property name=&quot;Xsl&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
             &lt;property name=&quot;CacheXslTimeOut&quot; type=&quot;int&quot;&gt;86400&lt;/property&gt;
             &lt;property name=&quot;WebId&quot; type=&quot;System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;00000000-0000-0000-0000-000000000000&lt;/property&gt;
             &lt;property name=&quot;ListUrl&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
             &lt;property name=&quot;DataSourceID&quot; type=&quot;string&quot; /&gt;
             &lt;property name=&quot;FireInitialRow&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
             &lt;property name=&quot;ManualRefresh&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
             &lt;property name=&quot;ViewFlags&quot; type=&quot;Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;&gt;Html, Hidden, FreeForm, Mobile&lt;/property&gt;
                   &lt;property name=&quot;ChromeState&quot; type=&quot;chromestate&quot;&gt;Normal&lt;/property&gt;
                   &lt;property name=&quot;AllowHide&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
                   &lt;property name=&quot;PageSize&quot; type=&quot;int&quot;&gt;-1&lt;/property&gt;
                   &lt;property name=&quot;SampleData&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
                   &lt;property name=&quot;BaseXsltHashKey&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
                   &lt;property name=&quot;AsyncRefresh&quot; type=&quot;bool&quot;&gt;False&lt;/property&gt;
                   &lt;property name=&quot;HelpMode&quot; type=&quot;helpmode&quot;&gt;Modeless&lt;/property&gt;
                   &lt;property name=&quot;ListId&quot; type=&quot;System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;2843ea1b-efe1-4fcc-a39b-a46121d3efd6&lt;/property&gt;
                   &lt;property name=&quot;DataSourceMode&quot; type=&quot;Microsoft.SharePoint.WebControls.SPDataSourceMode, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;&gt;List&lt;/property&gt;
                   &lt;property name=&quot;AllowMinimize&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
                   &lt;property name=&quot;TitleUrl&quot; type=&quot;string&quot;&gt;/Lists/Announcements&lt;/property&gt;
                   &lt;property name=&quot;CatalogIconImageUrl&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;DataSourcesString&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;GhostedXslLink&quot; type=&quot;string&quot;&gt;main.xsl&lt;/property&gt;
                  &lt;property name=&quot;PageType&quot; type=&quot;Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;&gt;PAGE_NORMALVIEW&lt;/property&gt;
                   &lt;property name=&quot;DisplayName&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;UseSQLDataSourcePaging&quot; type=&quot;bool&quot;&gt;True&lt;/property&gt;
                   &lt;property name=&quot;Width&quot; type=&quot;string&quot; &gt;88&lt;/property&gt;
                   &lt;property name=&quot;ExportMode&quot; type=&quot;exportmode&quot;&gt;All&lt;/property&gt;
                   &lt;property name=&quot;XslLink&quot; type=&quot;string&quot; null=&quot;true&quot; /&gt;
                   &lt;property name=&quot;ViewContentTypeId&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;HelpUrl&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;XmlDefinition&quot; type=&quot;string&quot;&gt;&amp;lt;View Name=&quot;{27B00113-EC28-4EE1-9D35-BC5BB645A7D0}&quot; MobileView=&quot;TRUE&quot; Type=&quot;HTML&quot; Hidden=&quot;TRUE&quot; TabularView=&quot;FALSE&quot; FreeForm=&quot;TRUE&quot; DisplayName=&quot;&quot; Url=&quot;/default.aspx&quot; Level=&quot;1&quot; BaseViewID=&quot;0&quot; ContentTypeID=&quot;0x&quot;&amp;gt;
                   &amp;lt;Query&amp;gt;
                   &amp;lt;Where&amp;gt;
                   &amp;lt;Or&amp;gt;
                   &amp;lt;IsNull&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Expires&quot;/&amp;gt;
                   &amp;lt;/IsNull&amp;gt;
                   &amp;lt;Geq&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Expires&quot;/&amp;gt;
                   &amp;lt;Value Type=&quot;DateTime&quot;
                   &amp;gt;&amp;lt;Today/&amp;gt;
                   &amp;lt;/Value&amp;gt;&amp;lt;/Geq&amp;gt;
                   &amp;lt;/Or&amp;gt;&amp;lt;/Where&amp;gt;
                   &amp;lt;OrderBy&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Modified&quot; Ascending=&quot;FALSE&quot;/&amp;gt;
                   &amp;lt;/OrderBy&amp;gt;&amp;lt;/Query&amp;gt;
                   &amp;lt;ViewFields&amp;gt;
                   &amp;lt;FieldRef Name=&quot;LinkTitleNoMenu&quot; Explicit=&quot;TRUE&quot;/&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Body&quot; Explicit=&quot;TRUE&quot;/&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Author&quot; Explicit=&quot;TRUE&quot;/&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Modified&quot; Explicit=&quot;TRUE&quot;/&amp;gt;
                   &amp;lt;FieldRef Name=&quot;Attachments&quot; Explicit=&quot;TRUE&quot;/&amp;gt;
                   &amp;lt;/ViewFields&amp;gt;&amp;lt;RowLimit&amp;gt;5&amp;lt;/RowLimit&amp;gt;
                   &amp;lt;Toolbar Type=&quot;Freeform&quot;/&amp;gt;
                   &amp;lt;/View&amp;gt;
                   &lt;/property&gt;
                   &lt;property name=&quot;Default&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;TitleIconImageUrl&quot; type=&quot;string&quot; /&gt;
                   &lt;property name=&quot;MissingAssembly&quot; type=&quot;string&quot;&gt;Cannot import this Web Part.&lt;/property&gt;
                   &lt;property name=&quot;SelectParameters&quot; type=&quot;string&quot; /&gt;
                   &lt;/properties&gt;
                   &lt;/data&gt;
                   &lt;/webPart&gt;
                   &lt;/webParts&gt;
                </webPartXml>
             <storage>Shared</storage>
          <allowTypeChange>false</allowTypeChange>
       </SaveWebPart2>
    </soap:Body>
 </soap:Envelope>

A sample response is similar to the following:

 <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><SaveWebPart2Response xmlns="http://microsoft.com/sharepoint/webpartpages" /></soap:Body></soap:Envelope>