Friday, November 28, 2008

Talk to SharePoint through its Web Services-Part 3


Versions Web Service

/_vti_bin/versions.asmx

Provides methods for working with file versions.

GetVersions

returns information about the versions of the specified file

fileName

DeleteAllVersions

Deletes all versions of the specified file.

fileName

DeleteVersion

Deletes the specified file version.

fileName, fileVersion

RestoreVersion

Restores the specified file version.

fileName, fileVersion

Method Name: GetVersions

protected void btn_Versions_Click(object sender, EventArgs e)

{

txt.Visible = true;

Versions.Versions vers = new Versions.Versions();

vers.Credentials = Mycredentials();

System.Xml.XmlNode node1 = vers.GetVersions("Pictures/asd.jpg");

txt.Text = node1.InnerXml.ToString();

}

Method Name: DeleteAllVersion

protected void btn_DeleteAllVersion_Click(object sender, EventArgs e)

{

txt_DeleteAllVersion.Visible = true;

Versions.Versions vers = new Versions.Versions();

vers.Credentials = Mycredentials();

try

{

System.Xml.XmlNode node1 = vers.DeleteAllVersions("Shared Documents/Fab20SiteTemplate.xlsx");

txt_DeleteAllVersion.Text = node1.InnerXml.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_DeleteAllVersion.Text = ex.Detail.OuterXml;

}

}

Method Name: DeleteVersion

protected void btn_DeleteVersion_Click(object sender, EventArgs e)

{

txt_DeleteVersion.Visible = true;

Versions.Versions vers = new Versions.Versions();

vers.Credentials = Mycredentials();

try

{

System.Xml.XmlNode node1 = vers.DeleteVersion("Shared Documents/dataview_wp.doc", "1");

txt_DeleteVersion.Text = node1.InnerXml.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_DeleteVersion.Text = ex.Detail.OuterXml;

}

}

Method Name: RestoreVersion

protected void btn_RestoreVersion_Click(object sender, EventArgs e)

{

txt_RestoreVersion.Visible = true;

Versions.Versions vers = new Versions.Versions();

vers.Credentials = Mycredentials();

try

{

System.Xml.XmlNode node1 = vers.RestoreVersion("Shared Documents/dataview_wp.doc", "1");

txt_RestoreVersion.Text = node1.InnerXml.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_RestoreVersion.Text = ex.Detail.OuterXml;

}

}

Views Web Service

/_vti_bin/Views.asmx

Provides methods for working with views of lists.

GetViewCollection

returns the display names,internal names, and URLs for the collection of views of the specified list.

listName

AddView

Creates a view for the specified list.

listName, viewName, viewFields, query, rowLimit, type, makeViewDefault

DeleteView

Deletes a view for the specified list

listName, viewName,

GetView<HTML>

Returns the full schema of the specified view for the specified list, including the <HTML> sections.

listName, viewName

UpdateView

Modifies the specified view of the specified list.

listName,
viewName,
viewProperties,
query,
viewFields,
aggregations,
formats,
rowLimit

UpdateView<HTML>

Updates the specified view with the supplied properties and values

listName, viewName, viewProperties, toolbar, viewHeader, viewBody, viewFooter, viewEmpty, rowLimitExceeded, query, viewFields, aggregations, formats, rowLimit

UpdateView<HTML>2

Updates the specified view with the supplied properties and values

listName, viewName, viewProperties, toolbar, viewHeader, viewBody, viewFooter, viewEmpty, rowLimitExceeded, query, viewFields, aggregations, formats, rowLimit,openApplicationExtension

Method Name: GetViewCollection

protected void btn_Views_Click(object sender, EventArgs e)

{

txt_views.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

System.Xml.XmlNode node1 = view.GetViewCollection("Pictures");

txt_views.Text = node1.OuterXml.ToString();

}

Method Name: AddView

protected void btn_AddView_Click(object sender, EventArgs e)

{

txt_AddView.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

string strQuery = "Saurabh";

string strRowLimit = "10";

string strViewFields = " ";

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

System.Xml.XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");

System.Xml.XmlNode ndRowLimit = xmlDoc.CreateNode(XmlNodeType.Element, "RowLimit", "");

System.Xml.XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");

ndQuery.InnerXml = strQuery;

ndRowLimit.InnerXml = strRowLimit;

ndViewFields.InnerXml = strViewFields;

try

{

XmlNode retNode = view.AddView("testlist", "testview", ndViewFields, ndQuery, ndRowLimit, "<HTML>", true);

txt_AddView.Text = "View Added Successfully";

}

catch(System.Web.Services.Protocols.SoapException ex)

{

txt_AddView.Text = ex.Detail.OuterXml;

}

}

Method Name: DeleteView

protected void btn_DeleteView_Click(object sender, EventArgs e)

{

txt_DeleteView.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

try

{

view.DeleteView("testlist", "8FC58309-D1E7-49E8-B3B2-31723DB148B0");

txt_DeleteView.Text = "View deleted Successfully";

}

catch(System.Web.Services.Protocols.SoapException ex)

{

txt_DeleteView.Text = ex.Detail.OuterXml;

}

}

Method Name: GetView<HTML>

protected void btn_GetView<HTML>_Click(object sender, EventArgs e)

{

txt_GetView<HTML>.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

XmlNode node1 = view.GetView<HTML>("testlist", "6A1B811D-019A-40D3-B5A9-41E06E44A8CF");

txt_GetView<HTML>.Text = node1.OuterXml;

}

Method Name: UpdateView

protected void btn_UpdateView_Click(object sender, EventArgs e)

{

txt_UpdateView.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

string strQuery = "Saurabh";

string strRowLimit = "10";

string strViewFields = " ";

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

System.Xml.XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");

System.Xml.XmlNode ndRowLimit = xmlDoc.CreateNode(XmlNodeType.Element, "RowLimit", "");

System.Xml.XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");

ndQuery.InnerXml = strQuery;

ndRowLimit.InnerXml = strRowLimit;

ndViewFields.InnerXml = strViewFields;

XmlNode node1 = view.UpdateView("testlist", "6A1B811D-019A-40D3-B5A9-41E06E44A8CF", null, ndQuery, ndViewFields, null, null, ndRowLimit);

txt_UpdateView.Text = "Updated Successfully";

}

Method Name: UpdateView<HTML>

protected void btn_UpdateView<HTML>_Click(object sender, EventArgs e)

{

txt_UpdateView<HTML>.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

XmlDocument xmlDoc = new System.Xml.XmlDocument();

string strViewEmpty = "<<HTML>> +

"

" +

"

]]><<HTML>> +

"

" +

"" +

"<<HTML>>" +

"<<HTML>>

]]>" +

"" +

"" +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"" +

"" +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"<<HTML>> +

"

]]>" +

"<<HTML>>

]]>" +

"" +

"<<HTML>>" +

" ]]>" +

"<<HTML>>All work items in the \"" +

"" +

"<<HTML>>\" list have been completed. See " +

"<<HTML>>" +

"" +

"<<HTML>>]]>" +

"<<HTML>>Announcements<<HTML>>]]>" +

"<<HTML>> for details." +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"<<HTML>>No records were found matching your query." +

"<<HTML>>]]>" +

"<<HTML>>

]]>" +

"<<HTML>>]]>" +

"" +

"<<HTML>>]]><<HTML>>]]>" +

"<<HTML>>

]]>" +

"<<HTML>>" +

"<<HTML>>" +

"<<HTML>>

]]>" +

"<<HTML>>

]]>";

XmlNode ndViewEmpty = xmlDoc.CreateNode(XmlNodeType.Element,"ViewEmpty","");

ndViewEmpty.InnerXml = strViewEmpty;

try

{

XmlNode node1 = view.UpdateView<HTML>("Announcements", "82167670-7BAD-40CC-98A0-8E0A6ABC4063", null, null, null, null, null, ndViewEmpty, null, null, null, null, null, null);

txt_UpdateView<HTML>.Text = node1.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_UpdateView<HTML>.Text = ex.Detail.OuterXml;

}

}

Method Name: UpdateView<HTML>2

protected void btn_UpdateView<HTML>2_Click(object sender, EventArgs e)

{

txt_UpdateView<HTML>2.Visible = true;

Views.Views view = new Views.Views();

view.Credentials = Mycredentials();

XmlDocument xmlDoc = new System.Xml.XmlDocument();

string strViewEmpty = "<<HTML>> +

"

" +

"

]]><<HTML>> +

"

" +

"" +

"<<HTML>>" +

"<<HTML>>

]]>" +

"" +

"" +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"" +

"" +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"<<HTML>> +

"

]]>" +

"<<HTML>>

]]>" +

"" +

"<<HTML>>" +

" ]]>" +

"<<HTML>>All work items in the \"" +

"" +

"<<HTML>>\" list have been completed. See " +

"<<HTML>>" +

"" +

"<<HTML>>]]>" +

"<<HTML>>Announcements<<HTML>>]]>" +

"<<HTML>> for details." +

"<<HTML>>]]>" +

"<<HTML>>]]>" +

"<<HTML>>No records were found matching your query." +

"<<HTML>>]]>" +

"<<HTML>>

]]>" +

"<<HTML>>]]>" +

"" +

"<<HTML>>]]><<HTML>>]]>" +

"<<HTML>>

]]>" +

"<<HTML>>" +

"<<HTML>>" +

"<<HTML>>

]]>" +

"<<HTML>>

]]>";

XmlNode ndViewEmpty = xmlDoc.CreateNode(XmlNodeType.Element, "ViewEmpty", "");

ndViewEmpty.InnerXml = strViewEmpty;

try

{

XmlNode node1 = view.UpdateView<HTML>2("Announcements", "82167670-7BAD-40CC-98A0-8E0A6ABC4063", null, null, null, null, null, ndViewEmpty, null, null, null, null, null, null,null);

txt_UpdateView<HTML>2.Text = node1.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_UpdateView<HTML>2.Text = ex.Detail.OuterXml;

}

}

Web Part Pages Web Service

/_vti_bin/webpartpages.asmx

Provides the methods to send information to and retrieve information from Web services.

GetWebPartPage

returns information about web part pages

documentName, behavior

AddWebPart

Adds a new Web Part to a Web Part Page.

pageUrl, webPartXml, storage

AddWebPartToZone

Adds a new Web Part to a Web Part Page, to a zone whose id is specified.

pageUrl, webPartXml, storage, zoneId, zoneIndex

Web Part Pages Web Service

AssociateWorkflowMarkup

ConvertWebPartFormat

Converts the web part format.

inputFormat, formatConversionOption

DeleteWebPart

Deletes a dynamic Web Part from a Web Part Page.

pageUrl, storageKey, storage

Web Part Pages Web Service

ExecuteProxyUpdates

FetchLegalWorkflowActions

Returns a string version of the actions file, as defined by the Actions File Schema

Web Part Pages Web Service

GetAssemblyMetaData

AssemblyName, BaseType

GetBindingResourceData

resourceName

GetCustomControlList

Returns a string of custom control list

Web Part Pages Web Service

GetDataFromDataSourceControl

Web Part Pages Web Service

GetFormCapabilityFromDataSourceControl

GetSafeAssemblyInfo

ets safe control assembly information

GetWebPart

Returns the XML data for a dynamic Web Part.

pageurl, storageKey, storage

GetWebPart2

Returns the XML data for a dynamic Web Part.

pageurl, storageKey, storage, behavior

GetWebPartCrossPageCompatibility

Returns connection information for all parts on the target page and compatibility information of the source Web Part with all the parts on a target page

sourcePageUrl, sourcePageContents, targetPageUrl, targetPageContents, providerPartID, lcid

GetWebPartPageConnectionInfo

Returns connection information for all parts on the same page as well as compatibility results for the provider part with other parts on the same page.

sourcePageUrl, sourcePageContents, providerPartID, lcid

GetWebPartPageDocument

Returns the Web Part Page, complete with the Web Parts and the properties included within each Web Part zone.

documentName

GetWebPartProperties

Returns an XML string of all Web Parts associated with a Web Part Page.

pageUrl, storage

GetWebPartProperties2

Returns an XML string of all Web Parts associated with a Web Part Page.

pageUrl, storage, behavior

GetXmlDataFromDataSource

Returns XML data from the data source provider.

queryXml

RemoveWorkflowAssociation

RenderWebPartForEdit

Returns an XML fragment that includes the Web Part property information and the rendering <HTML>.

webPartXml

SaveWebPart

Saves changes to an existing dynamic Web Part

pageUrl, storageKey, webPartXml, storage

SaveWebPart2

Saves changes to an existing dynamic Web Part

pageUrl, storageKey, webPartXml, storage, allowTypeChange

ValidateWorkflowMarkupAndCreateSupportObjects

Method Name: GetWebPartPage

protected void btn_WebPartPages_Click(object sender, EventArgs e)

{

txt_WebPartPages.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string strWP = wp.GetWebPartPage("default.aspx", WebPartPages.SPWebServiceBehavior.Version3);

txt_WebPartPages.Text = strWP.ToString();

}

Method Name: AddWebPart

protected void btn_AddWebPart_Click(object sender, EventArgs e)

{

txt_AddWebPart.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = strPageUrl;

string webPartXml = "\n" + "\n" +

"Content Editor Web Part\n " +

"Default\n " +

"Use for formatted text, tables, and images.\n " +

"true\n " +

"Header\n " +

"1\n " +

"Normal\n " +

"\n " +

"\n " +

"true\n " +

"true\n " +

"true\n " +

"true\n " +

"\n " +

"\n " +

"

Default\n " +

"\n " +

"\n " +

"/_layouts/images/mscontl.gif\n " +

"\n " +

"Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\n " +

"Microsoft.SharePoint.WebPartPages.ContentEditorWebPart\n " +

"\n " +

"Hello

]]>\n " +

"\n";

try

{

Guid newPartId = wp.AddWebPart(pageUrl, webPartXml, WebPartPages.Storage.Shared);

txt_AddWebPart.Text = newPartId.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_AddWebPart.Text = ex.Detail.OuterXml;

}

}

Method Name: AddWebPartToZone

protected void btn_AddWebPartToZone_Click(object sender, EventArgs e)

{

txt_AddWebPart.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = strPageUrl;

string webPartXml = "\n" + "\n" +

"Content Editor Web Part\n " +

"Default\n " +

"Use for formatted text, tables, and images.\n " +

"true\n " +

"Header\n " +

"1\n " +

"Normal\n " +

"\n " +

"\n " +

"true\n " +

"true\n " +

"true\n " +

"true\n " +

"\n " +

"\n " +

"

Default\n " +

"\n " +

"\n " +

"/_layouts/images/mscontl.gif\n " +

"\n " +

"Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c\n " +

"Microsoft.SharePoint.WebPartPages.ContentEditorWebPart\n " +

"\n " +

"Saurabh

]]>\n " +

"\n";

try

{

Guid newPartId = wp.AddWebPartToZone(pageUrl, webPartXml, WebPartPages.Storage.Shared, "CenterLeftColumn", 0);

txt_AddWebPartToZone.Text = newPartId.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_AddWebPartToZone.Text = ex.Detail.OuterXml;

}

}

Method Name: AssociateWorkflowMarkup

I m trying to find more information on configUrl

AssociateWorkflowMarkup (

string configUrl,

string configVersion

)

Method Name: ConvertWebPartFormat

protected void btn_ConvertWebPartFormat_Click(object sender, EventArgs e)

{

txt_ConvertWebPartFormat.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string strInpuFormat = @" Content Editor Web Part

Default

Use for formatted text, tables, and images.

true

TopLeftRow

0

Normal

true

true

true

true

true

true

true

Modeless

Default

Cannot import this Web Part.

/_layouts/images/mscontl.gif

Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Microsoft.SharePoint.WebPartPages.ContentEditorWebPart";

strInpuFormat += " ";

try

{

string strWebConvert = wp.ConvertWebPartFormat(strInpuFormat, WebPartPages.FormatConversionOption.ConvertToWebPartExportFormat);

txt_ConvertWebPartFormat.Text = strWebConvert;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_ConvertWebPartFormat.Text = ex.Detail.OuterXml;

}

}

Method Name: DeleteWebPart

protected void btn_DeleteWebPart_Click(object sender, EventArgs e)

{

txt_DeleteWebPart.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

Guid storageKey = new Guid("1c9ad190-3b39-42fe-a28d-cbb5d6433186");

try

{

wp.DeleteWebPart(pageUrl, storageKey, WebPartPages.Storage.Shared);

txt_DeleteWebPart.Text = "successfully deleted";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_DeleteWebPart.Text = ex.Detail.OuterXml;

}

}

Method Name: RemoveUserFromWeb

protected void btn_ExecuteProxyUpdates_Click(object sender, EventArgs e)

{

txt_ExecuteProxyUpdates.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string updateData = null;

try

{

string strExecuteProxyUpdate = wp.ExecuteProxyUpdates(updateData);

txt_ExecuteProxyUpdates.Text = strExecuteProxyUpdate;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_ExecuteProxyUpdates.Text = ex.Detail.OuterXml;

}

}

I m trying to find more information on UpdateData

Method Name: FetchLegalWorkflowActions

protected void btn_FetchLegalWorkflowActions_Click(object sender, EventArgs e)

{

txt_FetchLegalWorkflowActions.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

try

{

string strFetchLegalWorkflowActions = wp.FetchLegalWorkflowActions();

txt_FetchLegalWorkflowActions.Text = strFetchLegalWorkflowActions;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_FetchLegalWorkflowActions.Text = ex.Detail.OuterXml;

}

}

Method Name: GetAssemblyMetaData

protected void btn_GetAssemblyMetaData_Click(object sender, EventArgs e)

{

txt_GetAssemblyMetaData.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

try

{

string strGetAssemblyMetaData = wp.GetAssemblyMetaData(" ", "DocumentLibrary");

txt_GetAssemblyMetaData.Text = strGetAssemblyMetaData;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetAssemblyMetaData.Text = ex.Detail.OuterXml;

}

}

Need to find more information on assembly bastype.

Method Name: GetBindingResourceData

protected void btn_GetBindingResourceData_Click(object sender, EventArgs e)

{

txt_GetBindingResourceData.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string strResource = "VariationDataSource";

try

{

string strGetBindingResourceData = wp.GetBindingResourceData(strResource);

txt_GetBindingResourceData.Text = strGetBindingResourceData;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetBindingResourceData.Text = ex.Detail.OuterXml;

}

}

Method Name: GetCustomControlList

protected void btn_GetCustomControlList_Click(object sender, EventArgs e)

{

txt_GetCustomControlList.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

try

{

XmlNode node1 = wp.GetCustomControlList();

txt_GetCustomControlList.Text = node1.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetCustomControlList.Text = ex.Detail.OuterXml;

}

}

Method Name: GetDataFromDataSourceControl

Passed the below parameters to the webservice . I’m not able to find the information on dscXml

GetDataFromDataSourceControl (
string dscXml,
string contextUrl
)

Method Name: GetFormCapabilityFromDataSourceControl

Passed the below parameters to the webservice . I’m not able to find the information on dscXml

GetDataFromDataSourceControl (
string dscXml,
)

Method Name: GetSafeAssemblyInfo

protected void btn_GetSafeAssemblyInfo_Click(object sender, EventArgs e)

{

txt_GetCustomControlList.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

XmlNode node1 = wp.GetSafeAssemblyInfo();

txt_GetSafeAssemblyInfo.Text = node1.OuterXml;

}

Method Name: GetWebPart

protected void btn_GetWebPart_Click(object sender, EventArgs e)

{

txt_GetWebPart.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

Guid storageKey = new Guid("dac4c88b-9431-48a7-ac37-08cde64d6b5d");

try

{

string strGetWebPart = wp.GetWebPart(pageUrl, storageKey, WebPartPages.Storage.Shared);

txt_GetWebPart.Text = strGetWebPart;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetWebPart.Text = ex.Detail.OuterXml;

}

}

Method Name: GetWebPart2

protected void btn_GetWebPart2_Click(object sender, EventArgs e)

{

txt_GetWebPart2.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

Guid storageKey = new Guid("dac4c88b-9431-48a7-ac37-08cde64d6b5d");

try

{

string strGetWebPart2 = wp.GetWebPart2(pageUrl, storageKey, WebPartPages.Storage.Shared, WebPartPages.SPWebServiceBehavior.Version3);

txt_GetWebPart2.Text = strGetWebPart2;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetWebPart2.Text = ex.Detail.OuterXml;

}

}

Method Name: GetWebPartCrossPageCompatibility

protected void btn_GetWebPartCrossPageCompatibility_Click(object sender, EventArgs e)

{

txt_GetWebPartCrossPageCompatibility.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

string targetUrl = "asd.com/Pages/TargetWebPartPage.aspx";

XmlNode node1 = wp.GetWebPartProperties(pageUrl, WebPartPages.Storage.Shared);

string locId = "1033";

string sourcePartId = "";

foreach (XmlNode node in node1)

{

sourcePartId = node.Attributes["ID"].InnerText;

try

{

string strTest = wp.GetWebPartCrossPageCompatibility(pageUrl, "WebPartPage.aspx", targetUrl, "TargetWebPartPage.aspx", "dac4c88b-9431-48a7-ac37-08cde64d6b5d", locId);

txt_GetWebPartCrossPageCompatibility.Text = strTest;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetWebPartCrossPageCompatibility.Text = ex.Detail.OuterXml;

}

}

}

Method Name: GetWebPartPageConnectionInfo

protected void btn_GetWebPartPageConnectionInfo_Click(object sender, EventArgs e)

{

txt_GetWebPartPageConnectionInfo.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

XmlNode node1 = wp.GetWebPartProperties(pageUrl, WebPartPages.Storage.Shared);

string locId = "1033";

string sourcePartId = "";

foreach (XmlNode node in node1)

{

sourcePartId = node.Attributes["ID"].InnerText;

try

{

string strTest = wp.GetWebPartPageConnectionInfo(pageUrl, "WebPartPage.aspx", sourcePartId, locId);

txt_GetWebPartPageConnectionInfo.Text = strTest;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetWebPartPageConnectionInfo.Text = ex.Detail.OuterXml;

}

}

}

Method Name: GetWebPartPageDocument

protected void btn_GetWebPartPageDocument_Click(object sender, EventArgs e)

{

txt_GetWebPartPageDocument.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string strGetWebPartPageDocument = wp.GetWebPartPageDocument("/Pages/WebPartPage.aspx");

txt_GetWebPartPageDocument.Text = strGetWebPartPageDocument;

}

Method Name: GetWebPartProperties

protected void btn_GetWebPartProperties_Click(object sender, EventArgs e)

{

txt_GetWebPartProperties.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

XmlNode node1 = wp.GetWebPartProperties(pageUrl, WebPartPages.Storage.Shared);

txt_GetWebPartProperties.Text = node1.OuterXml;

}

Method Name: RemoveUserFromWeb

protected void btn_GetWebPartProperties2_Click(object sender, EventArgs e)

{

txt_GetWebPartProperties2.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

XmlNode node1 = wp.GetWebPartProperties2(pageUrl, WebPartPages.Storage.Shared, WebPartPages.SPWebServiceBehavior.Version3);

txt_GetWebPartProperties2.Text = node1.OuterXml;

}

Method Name: GetXmlDataFromDataSource

protected void btn_GetXmlDataFromDataSource_Click(object sender, EventArgs e)

{

txt_GetXmlDataFromDataSource.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string queryXml = "" +

"STSDataAdapter" +

"http://schemas.microsoft.com/sharepoint/dsp/queryRequest" +

"" +

"" +

" +

"select=\"/list[@id='{2CBA2845-13DE-4EF6-B5A8-AD9C216C4D9B}']\">" +

"" +

"" +

"" +

"" +

"" +

"" +

"" +

"" +

"" +

"" +

"" +

"1.0" +

"" +

"" +

"";

string strGetXmlData = wp.GetXmlDataFromDataSource(queryXml);

txt_GetXmlDataFromDataSource.Text = strGetXmlData;

}

Method Name: RemoveWorkflowAssociation

I m trying to find more information on configUrl

RemoveWorkflowAssociation (

string configUrl,

string configVersion

)

Method Name: RenderWebPartForEdit

protected void btn_RenderWebPartForEdit_Click(object sender, EventArgs e)

{

txt_RenderWebPartForEdit.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string strInpuFormat = @" Content Editor Web Part

Default

Use for formatted text, tables, and images.

true

CenterLeftColumn

0

Normal

true

true

true

true

true

true

true

Modeless

Default

/_layouts/images/mscontl.gif

Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Microsoft.SharePoint.WebPartPages.ContentEditorWebPart";

strInpuFormat += " Saurabh

]]> ";

try

{

string strWebConvert = wp.RenderWebPartForEdit(strInpuFormat);

txt_RenderWebPartForEdit.Text = strWebConvert;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_RenderWebPartForEdit.Text = ex.Detail.OuterXml;

}

}

Method Name: SaveWebPart

protected void btn_SaveWebPart_Click(object sender, EventArgs e)

{

txt_SaveWebPart.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

Guid storageKey = new Guid("dac4c88b-9431-48a7-ac37-08cde64d6b5d");

string strInpuFormat = @" Content Editor Web Part

Default

Use for formatted text, tables, and images.

true

CenterLeftColumn

0

Normal

true

true

true

true

true

true

true

Modeless

Default

/_layouts/images/mscontl.gif

Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Microsoft.SharePoint.WebPartPages.ContentEditorWebPart";

strInpuFormat += " Saurabh K. Tripathi

]]> ";

try

{

wp.SaveWebPart(pageUrl, storageKey, strInpuFormat, WebPartPages.Storage.Shared);

txt_SaveWebPart.Text = "web part saved";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_SaveWebPart.Text = ex.Detail.OuterXml;

}

}

Method Name: SaveWebPart2

protected void btn_SaveWebPart2_Click(object sender, EventArgs e)

{

txt_SaveWebPart2.Visible = true;

WebPartPages.WebPartPagesWebService wp = new WebPartPages.WebPartPagesWebService();

wp.Credentials = Mycredentials();

string pageUrl = "asd.com/Pages/WebPartPage.aspx";

Guid storageKey = new Guid("dac4c88b-9431-48a7-ac37-08cde64d6b5d");

string strInpuFormat = @" Content Editor Web Part

Default

Use for formatted text, tables, and images.

true

CenterLeftColumn

0

Normal

true

true

true

true

true

true

true

Modeless

Default

/_layouts/images/mscontl.gif

Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Microsoft.SharePoint.WebPartPages.ContentEditorWebPart";

strInpuFormat += " Saurabh

]]> ";

try

{

wp.SaveWebPart2(pageUrl, storageKey, strInpuFormat, WebPartPages.Storage.Shared, false);

txt_SaveWebPart2.Text = "web part saved";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_SaveWebPart2.Text = ex.Detail.OuterXml;

}

}

Method Name: RemoveUserFromWeb

wp.ValidateWorkflowMarkupAndCreateSupportObjects(string workflowMarkUpText, string rulesText,string configBlob,string flag)

not able to find information on
configBlob

Webs Web Service

/_vti_bin/Webs.asmx

Provides methods for working with sites and subsites.

GetWeb

Returns properties of a site (for example, name, description, and theme)

webUrl

CreateContentType

Creates a new site content type, with the specified columns and properties, on the site.

displayName,parentType,newFields,contentTypeProperties

CustomizeCss

Applies style sheet customization to a particular file.

cssFile

DeleteContentType

Deletes the specified site content type from the site.

contentTypeId

GetActivatedFeatures

Returns a list of Features that are activated in the Web site and in its parent site collection.

GetAllSubWebCollection

Returns the titles and URLs of all sites within the current site collection.

GetColumns

Returns a collection of the column definitions for the columns available on the site.

GetContentType

Returns the content type definition for the specified site content type.

contentTypeId

GetContentTypes

Returns a collection of content type definitions for all site content types on the specified site.

GetCustomizedPageStatus

Gets the customization (also known as "ghosted") status of the file with the specified URL.

fileUrl

GetListTemplates

Returns the collection of list template definitions for the current site

WebUrlFromPageUrl

Returns the URL of the parent site for the specified page URL.

pageUrl

GetWebCollection

Returns the titles and URLs of all sites directly beneath the current site.

RemoveContentTypeXmlDocument

Removes the specified XmlDocument Element (ContentType) element from the specified site content type.

contentTypeId
A string that represents the content type ID for the site content type.

documentUri
A string that represents the URI of the XMLDocument element to remove.

RevertAllFileContentStreams

Reverts the content streams of all files within the Web site.

RevertCss

Reverts style sheet customization of a file to the default style sheet.

cssFile

RevertFileContentStream

Reverts the content streams Specified files within the Web site.

strUrl

UpdateColumns

Creates, updates, or deletes one or more columns on the specified site.

newFields, updateFields, deleteFields

UpdateContentType

Updates the specified site content type.

contentTypeId
A string that represents the content type ID of the site content type to update.

contentTypeProperties
A string that represents the properties to update on the site content type.

Format the properties as a ContentType Element (ContentType) element, and include the element attributes for the properties you want to update.

newFields
A string that represents the collection of columns to add to the site content type.

Format the column collection as a FieldRefs Element (ContentType) element, where each FieldRef Element (ContentType) child element references a site column to add to the site content type.

updateFields
A string that represents the collection of columns to update on the site.

Format the column collection as a FieldRefs Element (ContentType) element, where each FieldRef Element (ContentType) child element references a column to update on the site content type.

In each FieldRef Element (ContentType) child element, include the element attributes for the column properties you want to update.

deleteFields
A string that represents the collection of columns to delete from the site content type.

UpdateContentTypeXmlDocument

Adds or overwrites the specified XMLDocument element in the specified list content type.

listName
A string that represents the name of the list.

contentTypeId
A string that represents the content type ID of the content type to which to add or update the XMLDocument element.

newDocument
A string representing the XML document to replace the existing XML document.

Method Name: GetWeb

protected void btn_Web_Click(object sender, EventArgs e)

{

txt_web.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

System.Xml.XmlNode node1 = web.GetWeb("asd.com");

txt_web.Text = node1.OuterXml.ToString();

}

Method Name: CreateContentType

protected void btn_CreateContentType_Click(object sender, EventArgs e)

{

try

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string displayName = "myNewContentType";

string parentType = "0x0101";

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

System.Xml.XmlNode newFields = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "FieldRefs", "");

System.Xml.XmlNode contentTypeProperties = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "ContentType", "");

System.Xml.XmlAttribute xmlPropsDesc = xmlDoc.CreateAttribute("Description");

xmlPropsDesc.Value = "New content type description";

contentTypeProperties.Attributes.Append(xmlPropsDesc);

string contentTypeId;

contentTypeId = web.CreateContentType(displayName, parentType, newFields, contentTypeProperties);

//ContentID = contentTypeId;

lblCreateContentType.Text = contentTypeId;

}

catch (Exception ex)

{

lblCreateContentType.Text = "contentTypeId is already exists";

}

}

Method Name: CustomizeCss

protected void btn_CustomizeCss_Click(object sender, EventArgs e)

{

txt_CustomizeCss.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strCss = "asd.com/Shared Documents/corefixup.css";

try

{

web.CustomizeCss(strCss);

txt_CustomizeCss.Text = "Success";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_CustomizeCss.Text = ex.Detail.OuterXml;

}

}

Method Name: RemoveUserFromWeb

protected void btn_DeleteContentTypeWebs_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string contentTypeId = "0x010100D3A967D4FB63AA4BADCAAE4F79CB98D3";

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

System.Xml.XmlNode xmlResult = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "Result", "");

try

{

xmlResult.InnerXml = web.DeleteContentType(contentTypeId).OuterXml.ToString();

lblDeleteContentTypeWebs.Text = xmlResult.OuterXml.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

lblDeleteContentTypeWebs.Text = ex.Detail.OuterXml;

}

}

Method Name: GetActivatedFeatures

protected void btn_GetActivatedFeatures_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

lblGetActivatedFeatures.Text = web.GetActivatedFeatures();

}

Method Name: GetAllSubWebCollection

protected void btn_GetAllSubWebCollection_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strMessage = "";

System.Xml.XmlNode myNode = web.GetAllSubWebCollection(); System.Xml.XmlNodeList nodes = myNode.SelectNodes("*");

foreach (System.Xml.XmlNode node in nodes)

{

strMessage = strMessage + node.Attributes["Title"].Value + "\n";

}

lblGetAllSubWebCollection.Text = strMessage;

}

Method Name: GetColumns

protected void btn_GetColumns_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

try

{

System.Xml.XmlNode myNode = web.GetColumns();

txt_GetColumn.Text = myNode.OuterXml;

}

catch (Exception ex)

{

txt_GetColumn.Text = ex.Message;

}

}

Method Name: GetContentType

protected void btn_GetContentType_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string contentTypeId = "0x0101";

System.Xml.XmlNode myNode = web.GetContentType(contentTypeId);

txtGetContentType.Text = myNode.OuterXml;

}

Method Name: GetContentTypes

protected void btn_GetContentTypes_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

System.Xml.XmlNode myNode = web.GetContentTypes();

txtGetContentTypes.Text = myNode.OuterXml;

}

Method Name: GetCustomizedPageStatus

protected void btn_GetCustomizedPageStatus_Click(object sender, EventArgs e)

{

txt_GetCustomizedPageStatus.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

try

{

Webs.CustomizedPageStatus CusPageStatus= web.GetCustomizedPageStatus("asd.com/Pages/WebPartPage.aspx");

txt_GetCustomizedPageStatus.Text = CusPageStatus.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_GetCustomizedPageStatus.Text = ex.Detail.OuterXml;

}

}

Method Name: GetListTemplates

protected void btn_GetListTemplates_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strMessage = "";

System.Xml.XmlNode myNode = web.GetListTemplates();

System.Xml.XmlNodeList nodes = myNode.SelectNodes("*[@BaseType=0]");

foreach (System.Xml.XmlNode node in nodes)

{

strMessage = strMessage + node.Attributes["Name"].Value + "\n";

}

lblGetListTemplates.Text = strMessage;

}

Method Name: WebUrlFromPageUrl

protected void btn_WebUrlFromPageUrl_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strPageUrl = "asd.com/Lists/Tasks/AllItems.aspx";

string strSiteUrl = web.WebUrlFromPageUrl(strPageUrl);

lblWebUrlFromPageUrl.Text = strSiteUrl;

}

Method Name: GetWebCollection

protected void btn_GetWebCollection_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strMessage = "";

System.Xml.XmlNode myNode = web.GetWebCollection();

System.Xml.XmlNodeList nodes = myNode.SelectNodes("*");

foreach (System.Xml.XmlNode node in nodes)

{

strMessage = strMessage + node.Attributes["Title"].Value + "\n";

}

lblGetWebCollection.Text = strMessage;

}

Method Name: RemoveContentTypeXmlDocument

protected void btn_RemoveContentTypeXmlDocument_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Url = "asd.com/_vti_bin/webs.asmx";

web.Credentials = Mycredentials();

try

{

System.Xml.XmlNode returnValue = web.RemoveContentTypeXmlDocument("0x0101", "asd.com/_layouts/ManageContentType.aspx");

txtRemoveContentTypeXmlDocument.Text = returnValue.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtRemoveContentTypeXmlDocument.Text = ex.Detail.OuterXml;

}

}

Method Name: RevertAllFileContentStreams

protected void btn_RevertAllFileContentStreams_Click(object sender, EventArgs e)

{

txt_RevertAllFileContentStreams.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

web.RevertAllFileContentStreams();

txt_RevertAllFileContentStreams.Text = "Success";

}

Method Name: RevertCss

protected void btn_RevertCss_Click(object sender, EventArgs e)

{

txt_RevertCss.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strCss = "asd.com/Shared%20Documents/corefixup.css";

try

{

web.RevertCss(strCss);

txt_RevertCss.Text = "Success";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_RevertCss.Text = ex.Detail.OuterXml;

}

}

Method Name: RevertFileContentStream

protected void btn_RevertFileContentStream_Click(object sender, EventArgs e)

{

txt_RevertFileContentStream.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

string strUrl = "asd.com/default.aspx";

try

{

web.RevertFileContentStream(strUrl);

txt_RevertFileContentStream.Text = "Success";

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_RevertFileContentStream.Text = ex.Detail.OuterXml;

}

}

Method Name: UpdateColumns

protected void btn_UpdateColumns_Click(object sender, EventArgs e)

{

txt_UpdateColumns.Visible = true;

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

System.Xml.XmlElement newFields = xDoc.CreateElement("Fields");

System.Xml.XmlElement updateFields = xDoc.CreateElement("Fields");

System.Xml.XmlElement deleteFields = xDoc.CreateElement("Fields");

newFields.InnerXml = "";

newFields.InnerXml = "";

deleteFields.InnerXml = "";

try

{

XmlNode node1 = web.UpdateColumns(newFields, updateFields, deleteFields);

txt_UpdateColumns.Text = node1.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txt_UpdateColumns.Text = ex.Detail.OuterXml;

}

}

Method Name: RemoveUserFromWeb

Method Name: UpdateContentTypeWebs

protected void btn_UpdateContentTypeWebs_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Url = "asd.com/_vti_bin/webs.asmx";

web.Credentials = Mycredentials();

System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

System.Xml.XmlElement newFields = xDoc.CreateElement("Fields");

System.Xml.XmlElement updateFields = xDoc.CreateElement("Fields");

System.Xml.XmlElement deleteFields = xDoc.CreateElement("Fields");

newFields.InnerXml = "";

newFields.InnerXml = "";

deleteFields.InnerXml = "";

try

{

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

System.Xml.XmlNode contentTypeProperties = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "ContentType", "");

System.Xml.XmlNode returnValue = web.UpdateContentType("0x0101", contentTypeProperties, newFields, updateFields, deleteFields);

txtUpdateContentType.Text = returnValue.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtUpdateContentType.Text = ex.Detail.OuterXml;

}

}

Method Name: UpdateContentTypeXmlDocumentWebs

protected void btn_UpdateContentTypeXmlDocumentWebs_Click(object sender, EventArgs e)

{

Webs.Webs web = new Webs.Webs();

web.Credentials = Mycredentials();

System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();

System.Xml.XmlElement newFields = xDoc.CreateElement("Fields");

newFields.InnerXml = "";

newFields.InnerXml = "";

try

{

System.Xml.XmlNode returnValue = web.UpdateContentTypeXmlDocument("0x0101", newFields);

txtUpdateContentTypeXmlDocument.Text = returnValue.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtUpdateContentTypeXmlDocument.Text = ex.Detail.OuterXml;

}

}

Publishing Service Web Service

/_vti_bin/PublishingService.asmx

Provides methods to remotely work with the publishing service.

GetObjectStatus

Returns object publishing status like Modified date, version etc

fileName

CreatePageLayout

Creates a new PageLayout object.

pageLayoutName, associatedContentTypeId, title, description, siteUrl

DisconnectPageLayout

Disconnect a PublishingPage object from its PageLayout to make its markup a copy of the page layout's markup.

pageUrl

Publishing Service Web Service

ExportObjects

Publishing Service Web Service

GetObjectStatusCollection

returns status of object specified

Publishing Service Web Service

GetObjectStatusCollectionWithExclusions

ImportObjects

ReconnectPageLayout

Use this method to reconnect a PublishingPage object to its PageLayout object and replace its custom markup with default PublishingPage markup.

pageUrl

Wait

waits for specified time

millisecond

Method Name: GetObjectStatus

protected void btn_Publishing_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

PublishingService.PublishingObjectStatus pub = pubserv.GetObjectStatus("Shared Documents/Fab20SiteTemplate.xls");

DateTime dt = new DateTime();

dt = pub.LastMajorModifiedTime.Date;

lbl_ModifiedDate.Text = dt.ToString("MMMM d");

}

Method Name: CreatePageLayout

protected void btn_CreatePageLayout_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

pubserv.AllowAutoRedirect = false;

string test= pubserv.CreatePageLayout("test.aspx", "0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D", "Test Layout Page", "No Description", "asd.com");

lbl_CreatePageLayout.Text = "Layout Page Created Succssfully";

}

Method Name: DisconnectPageLayout

protected void btn_DisconnectPageLayout_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

pubserv.AllowAutoRedirect = false;

pubserv.DisconnectPageLayout("asd.com/Pages/testpage.aspx");

lbl_DisconnectPageLayout.Text = "Layout Page disconnected Succssfully";

}

Method Name: ExportObjects

protected void btn_ExportObjects_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

string webUrl = "asd.com/Pages/WebPartPage.aspx";

try

{

if (!string.IsNullOrEmpty(webUrl))

{

byte[] compressedFileContent = pubserv.ExportObjects(webUrl);

File.WriteAllBytes(Path.GetTempFileName(), compressedFileContent);

}

}

catch (System.Web.Services.Protocols.SoapException ex)

{

lbl_ExportObjects.Text = ex.Detail.OuterXml;

}

}

Method Name: ImportObjects

protected void btn_ImportObjects_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

string siteUrl = "http://localhost:1003/default.aspx";

string compressedFileName = "C:\\XMLNodeParaMeters\\SiteBackup.cmp";

byte[] fileContent = File.ReadAllBytes(compressedFileName);

if (!string.IsNullOrEmpty(siteUrl))

{

bool import= pubserv.ImportObjects(siteUrl, fileContent);

lbl_ImportObjects.Text = import.ToString();

}

}

Method Name: GetObjectStatusCollection

protected void btn_GetObjectStatusCollection_Click(object sender, EventArgs e)

{

string[] objectUrls = new string[2];

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

objectUrls[0] = "Shared Document/dataview_wp.doc";

objectUrls[1] = "Shared Documents/Fab20SiteTemplate.xls";

try

{

PublishingService.PublishingObjectStatus[] pubobst = pubserv.GetObjectStatusCollection(objectUrls);

lbl_GetObjectStatusCollection.Text = pubobst.Length.ToString();

}

catch (System.Web.Services.Protocols.SoapException ex)

{

lbl_GetObjectStatusCollection.Text = ex.Detail.OuterXml;

}

}

Method Name: ReconnectPageLayout

protected void btn_ReconnectPageLayout_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

pubserv.AllowAutoRedirect = false;

pubserv.ReconnectPageLayout("asd.com/Pages/testpage.aspx");

lbl_ReconnectPageLayout.Text = "Layout Page connected Succssfully";

}

Method Name: Wait

protected void btn_Wait_Click(object sender, EventArgs e)

{

PublishingService.PublishingService pubserv = new PublishingService.PublishingService();

pubserv.Credentials = Mycredentials();

pubserv.Wait(100);

lbl_Wait.Text = "wait for 100 millisecond ";

}

Forms Web Service

/_vti_bin/Forms.asmx

Provides methods for returning forms used in the user interface when working with the contents of a list.

GetFormCollection

Returns the URLs and types of the forms for a list.

listname

GetForm

Returns the schema of a form for a specified list based on the name of the list and the URL of the form.

listname,formurl

Method Name: GetFormCollection

protected void btn_Form_Click(object sender, EventArgs e)

{

TextBox1.Visible = true;

Forms.Forms formservice = new Forms.Forms();

formservice.Credentials = Mycredentials();

System.Xml.XmlNode node1 = formservice.GetFormCollection("Pictures");

TextBox1.Text = node1.OuterXml.ToString();

}

Method Name: GetForm

protected void btn_GetForm_Click(object sender, EventArgs e)

{

txt_GetForm.Visible = true;

Forms.Forms formservice = new Forms.Forms();

formservice.Credentials = Mycredentials();

System.Xml.XmlNode node1 = formservice.GetForm("testlist", "/Lists/testlist/NewForm.aspx");

txt_GetForm.Text = node1.OuterXml.ToString();

}

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

StartWorkFlow

Starts a workflow for specified item

item,templateId,workflowParameters

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

AlterToDo

Updates the task information for a specific workflow task.

item, todoId, todoListId, taskData

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

ClaimReleaseTask

Claims or releases a task.

item, taskId, listId, fClaim

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

GetTemplatesForItem

Gets the workflow templates that are available for a specific SharePoint item.

Item

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

GetToDosForItem

gets the workflow TODOs for specific workflow task

Item

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

GetWorkflowDataForItem

Gets the workflow data for a specific user for a given SharePoint item.

Item

WorkFlow Web Service

/_vti_bin/WorkFlow.asmx

GetWorkflowTaskData

Gets the workflow tasks data for a specific workflow task.

item, taskId, listId

Method Name: StartWorkflow

protected void btn_StartWorkflow_Click(object sender, EventArgs e)

{

WorkFlow.Workflow ws = new WorkFlow.Workflow();

ws.Url = "asd.com/_vti_bin/workflow.asmx";

ws.Credentials = Mycredentials();

System.Xml.XmlNode wfTemplatesXML = ws.GetTemplatesForItem("asd.com/WorkflowDocuments/WorkFlow.doc");

System.Xml.XmlNamespaceManager nsmgr = new System.Xml.XmlNamespaceManager(wfTemplatesXML.OwnerDocument.NameTable);

nsmgr.AddNamespace("wf", "http://schemas.microsoft.com/sharepoint/soap/workflow/");

System.Xml.XmlNode dataNode = wfTemplatesXML.SelectSingleNode("//wf:AssociationData/wf:string", nsmgr);

System.Xml.XmlDocument doc = new XmlDocument();

doc.LoadXml(dataNode.InnerText);

System.Xml.XmlNode idNode = wfTemplatesXML.SelectSingleNode("//wf:WorkflowTemplateIdSet", nsmgr);

Guid templateID = new Guid(idNode.Attributes.GetNamedItem("TemplateId").Value);

try

{

System.Xml.XmlNode xnode = ws.StartWorkflow("asd.com/WorkflowDocuments/WorkFlow.doc",

templateID, doc.DocumentElement);

txtStartWorkflow.Text = xnode.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtStartWorkflow.Text = ex.Detail.OuterXml;

}

}

Method Name: AlterToDo

protected void btn_AlterToDo_Click(object sender, EventArgs e)

{

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Url = "asd.com/_vti_bin/workflow.asmx";

wf.Credentials = Mycredentials();

wf.PreAuthenticate = true;

XmlDocument taskData = new XmlDocument();

taskData.LoadXml(@"

success of the test sent!
0.500000000000000");

Guid listid = new Guid("61B471ED-8926-46FA-A6B0-91D1C48D5069");

int id = 1;

try

{

System.Xml.XmlNode result = wf.AlterToDo("asd.com/Lists/Tasks/new", id, listid, taskData);

txtAlterToDo.Text = result.Attributes["ows_PercentComplete"].Value;// result.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtAlterToDo.Text = ex.Detail.OuterXml;

}

}

Method Name: RemoveUserFromWeb

protected void btn_ClaimReleaseTask_Click(object sender, EventArgs e)

{

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Url = "asd.com/_vti_bin/workflow.asmx";

wf.Credentials = Mycredentials();

Guid listid = new Guid("61B471ED-8926-46FA-A6B0-91D1C48D5069");

int id = 2;

try

{

System.Xml.XmlNode xnode = wf.ClaimReleaseTask("asd.com/Lists/Tasks/ClaimReleaseTask", id, listid, true);

txtClaimReleaseTask.Text = xnode.OuterXml;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtClaimReleaseTask.Text = ex.Detail.OuterXml;

}

}

Method Name: GetTemplatesForItem

protected void btn_GetTemplatesForItem_Click(object sender, EventArgs e)

{

txt_GetTemplatesForItem.Visible = true;

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Credentials = Mycredentials();

System.Xml.XmlNode node1 = wf.GetTemplatesForItem("asd.com/Document/dataview_wp.doc");

txt_GetTemplatesForItem.Text = node1.OuterXml.ToString();

}

Method Name: GetToDosForItem

protected void btn_WorkFlow_Click(object sender, EventArgs e)

{

txt_WorkFlow.Visible = true;

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Credentials = Mycredentials();

System.Xml.XmlNode node1 = wf.GetToDosForItem("asd.com/Document/dataview_wp.doc");

txt_WorkFlow.Text = node1.OuterXml.ToString();

}

Method Name: GetWorkflowDataForItem

protected void btn_GetWorkflowDataForItem_Click(object sender, EventArgs e)

{

txt_GetWorkflowDataForItem.Visible = true;

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Credentials = Mycredentials();

System.Xml.XmlNode node1 = wf.GetWorkflowDataForItem("asd.com/Document/dataview_wp.doc");

txt_GetWorkflowDataForItem.Text = node1.OuterXml.ToString();

}

Method Name: RemoveUserFromWeb

protected void btn_GetWorkflowTaskData_Click(object sender, EventArgs e)

{

WorkFlow.Workflow wf = new WorkFlow.Workflow();

wf.Url = "asd.com/_vti_bin/workflow.asmx";

wf.Credentials = Mycredentials();

Guid LIstID = new Guid("61B471ED-8926-46FA-A6B0-91D1C48D5069");

int id = 1;

try

{

System.Xml.XmlNode xnode = wf.GetWorkflowTaskData("asd.com/Lists/Tasks/new", id, LIstID);

txtGetWorkflowTaskData.Text = xnode.Attributes["ows_Title"].Value;

}

catch (System.Web.Services.Protocols.SoapException ex)

{

txtGetWorkflowTaskData.Text = ex.Detail.OuterXml;

}

}


1 comment:

Sangram Gawade said...

Hi Saurabh..
Please Tell me How to use GetWebpartPageDocument properties Url I am getting server exception that we could not access this page please contact Administrator