Skip to main content
Nintex Community Menu Bar

XML Issue in Web Service Call Action 'AddWebPart' method

  • September 14, 2020
  • 0 replies
  • 9 views

Forum|alt.badge.img

I have been facing an issue with the web service call to webpartpages.asmx web service and calling "AddWebPart" method with the following code .The response received is always "The remote server returned an error: (400) Bad Request." message.

I have added the action to checkout the page before calling the action below. 8926iFC1A3A9883940FDD.png

Also , the source code is as below

<?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> <AddWebPart xmlns="http://microsoft.com/sharepoint/webpartpages"> <pageUrl>/SiteAssets/welcome.aspx</pageUrl> <webPartXml> <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2"> <Title>CSOM Content Editor</Title> <FrameType>None</FrameType> <Description>Allows authors to enter rich text content.</Description> <IsIncluded>true</IsIncluded> <ZoneID>Header</ZoneID> <PartOrder>0</PartOrder> <FrameState>Normal</FrameState> <Height /> <Width /> <AllowRemove>true</AllowRemove> <AllowZoneChange>true</AllowZoneChange> <AllowMinimize>true</AllowMinimize> <AllowConnect>true</AllowConnect> <AllowEdit>true</AllowEdit> <AllowHide>true</AllowHide> <IsVisible>true</IsVisible> <DetailLink /> <HelpLink /> <HelpMode>Modeless</HelpMode> <Dir>Default</Dir> <PartImageSmall /> <MissingAssembly>Cannot import this Web Part.</MissingAssembly> <PartImageLarge>/_layouts/15/images/mscontl.gif</PartImageLarge> <IsIncludedFilter /> <Assembly>Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly> <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName> <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"> </ContentLink> <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"> <div id="MyDiv"> Test WebPart</div> </Content> <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /> </WebPart> </webPartXml> <storage>Shared</storage> </AddWebPart> </soap12:Body> </soap12:Envelope>

 Can you please assist with the above XML so that a web part can be added through the workflow.