MethodInstance.MergeXml Method

Reads the MethodInstance definition from the specified resource XML for the specified method, and then merges its properties, localized names, and access control entries with the existing MethodInstance in the metadata store.

Namespace:  Microsoft.SharePoint.BusinessData.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function MergeXml ( _
    xml As String, _
    <OutAttribute> ByRef errors As String(), _
    packageContents As PackageContents, _
    method As Method, _
    settingId As String _
) As MethodInstance
'Usage
Dim xml As String
Dim errors As String()
Dim packageContents As PackageContents
Dim method As Method
Dim settingId As String
Dim returnValue As MethodInstance

returnValue = MethodInstance.MergeXml(xml, _
    errors, packageContents, method, _
    settingId)
public static MethodInstance MergeXml(
    string xml,
    out string[] errors,
    PackageContents packageContents,
    Method method,
    string settingId
)

Parameters

  • errors
    Type: []

    A list of the noncritical errors that occurred when merging data or reading the XML.

  • settingId
    Type: System.String

    The identifier of a partition in the metadata store to store properties, localized names, and access control entries in; a null reference (Nothing in Visual Basic) indicates default settings.

Return Value

Type: Microsoft.SharePoint.BusinessData.Administration.MethodInstance
The merged method instance.

Exceptions

Exception Condition
ArgumentNullException

The xml or the method parameter is a null reference (Nothing in Visual Basic).

ArgumentException

The packageContents parameter has the PackageContents.Model value set.

MetadataObjectNotFoundException

The MethodInstance does not exist in the specified method.

Remarks

This method allows you to specify which resources that are present in the specified metadata XML string are to be added to the metadata store via the packageContents parameter.

If the Properties value is specified in the packageContents parameter, BDC will create all the properties in the given XML string in the specified setting. If a property with the same name exists, it will be replaced by the new property. Merging Properties requires “Edit” permissions in the specified setting.

If the LocalizedNames value is specified in the packageContents parameter, BDC will create all the localized names in the given XML string in the specified setting. If a localized name with the same LCID exists, it will be replaced by the new localized name. Merging localized names requires “Edit” permissions in the specified setting.

If the Permissions value is specified in the packageContents parameter, BDC will replace existing permissions with the new permissions taken from the given XML string. Merging permissions requires the “SetPermissions” permission in the specified setting.

See Also

Reference

MethodInstance Class

MethodInstance Members

Microsoft.SharePoint.BusinessData.Administration Namespace