3.1.4.13 Delete

The Delete operation deletes the specified MetadataObject.

The following is the WSDL port type specification of the Delete WSDL operation.

 <wsdl:operation name="Delete" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:input wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/Delete" message="tns:BusinessDataCatalogSharedService_Delete_InputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:output wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteResponse" message="tns:BusinessDataCatalogSharedService_Delete_OutputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteArgumentExceptionFault" name="ArgumentExceptionFault" message="tns:BusinessDataCatalogSharedService_Delete_ArgumentExceptionFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteArgumentNullExceptionFault" name="ArgumentNullExceptionFault" message="tns:BusinessDataCatalogSharedService_Delete_ArgumentNullExceptionFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteArgumentOutOfRangeExceptionFault" name="ArgumentOutOfRangeExceptionFault" message="tns:BusinessDataCatalogSharedService_Delete_ArgumentOutOfRangeExceptionFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteBdcExceptionStateFault" name="BdcExceptionStateFault" message="tns:BusinessDataCatalogSharedService_Delete_BdcExceptionStateFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteInvalidOperationExceptionFault" name="InvalidOperationExceptionFault" message="tns:BusinessDataCatalogSharedService_Delete_InvalidOperationExceptionFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://www.microsoft.com/Office/2009/BusinessDataCatalog/BusinessDataCatalogSharedService/DeleteMetadataExceptionStateFault" name="MetadataExceptionStateFault" message="tns:BusinessDataCatalogSharedService_Delete_MetadataExceptionStateFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
 </wsdl:operation>

The protocol client sends a BusinessDataCatalogSharedService_Delete_InputMessage request message, and the protocol server MUST respond with a BusinessDataCatalogSharedService_Delete_OutputMessage response message, unless any faults occur.

If any one of the conditions in the following table is met, the protocol server MUST instead respond with a SOAP fault containing the corresponding error complex type, serialized as specified in section 2.2.4. If more than one error condition is encountered, the protocol server MUST respond with exactly one error complex type, determined in an implementation-specific manner.

Error complex type

Condition

AccessDeniedExceptionState (from namespace http://schemas.datacontract.org/2004/07/Microsoft.BusinessData.Infrastructure)

The security principal in whose context the protocol client is operating is not authorized to modify the specified MetadataObject, or the specified MetadataObject is a Model and the security principal in whose context the protocol client is operating is not authorized to modify one or more of the LobSystems that contain one or more Entity referenced by the specified Model.

ConcurrentModificationExceptionState (from namespace Microsoft.SharePoint.BusinessData)

The specified MetadataObject has been updated by a context other than the one by which it is currently being read. This happens when the specified object version is not equal to the current object version of the MetadataObject. For example, this error can be raised when one context reads the given MetadataObject, another context updates the same MetadataObject, and then the original context tries to update the same MetadataObject.

InvalidOperationException (from namespace http://schemas.datacontract.org/2004/07/System)

The operation cannot be performed because the specified MetadataObject is an Entity, which, if active, MUST be deactivated before being deleted. An attempt was made by the server to deactivate the Entity, but, at the time of the attempt, the Entity was no longer active.

InvalidOperationException (from namespace http://schemas.datacontract.org/2004/07/System)

The operation cannot be performed because the specified MetadataObject is a FilterDescriptor of type TimeStampFilter and is currently used in a MethodInstance of type ChangedIdEnumerator or DeletedIdEnumerator.

InvalidOperationException (from namespace http://schemas.datacontract.org/2004/07/System)

The specified MetadataObject is a LobSystem that contains at least one Entity.

InvalidOperationException (from namespace http://schemas.datacontract.org/2004/07/System)

The operation cannot be performed because the specified MetadataObject is a TypeDescriptor and there is already at least one MethodInstance whose ReturnTypeDescriptor is the specified TypeDescriptor.

MetadataObjectNotFoundExceptionState (from namespace Microsoft.SharePoint.BusinessData)

The specified MetadataObject does not exist.

Properties that are child objects of the specified MetadataObject MUST also be deleted. If the MetadataObjectStruct element specifies any of the MetadataObjects in the following table, the protocol server MUST perform the corresponding actions, in addition to deleting the specified MetadataObject from the metadata store.

MetadataObject

Action

Action

Delete all ActionParameters in the specified Action.

Entity

Delete all Action, Method, Identifier, and AssociationGroups that are child objects of the specified Entity, as well as all their child objects, in a recursive manner. If the LobSystem that is the parent of this Entity contains no other Entities, also delete the LobSystem, as well as all the MetadataObjects contained by the LobSystem in a recursive manner.

LobSystem

Delete all LobSystemInstances that are child objects of the specified LobSystem.

Method

Delete all MethodInstance, FilterDescriptor, and Parameters that are child objects of the specified Method, as well as all their child objects, in a recursive manner.<39>

Model

Delete all LobSystems and Entities that are referenced by the specified Model, as well as all their child objects, in a recursive manner.

Parameter

Delete the root TypeDescriptor of the specified Parameter, as well as all the child objects of the root TypeDescriptor, in a recursive manner.<40> If there are several parameters that exist in the same method, and one of the parameters is deleted, then the objectVersion of the other parameters are incremented by 1, and the ordinalNumber of the other parameters are changed according to the following rules:

1. If the parameter is deleted, the ordinalNumber value of the parameters whose ordinalNumber values are greater than this parameter are reduced by 1.

2. If the parameter is deleted, the ordinalNumber value of the parameters whose ordinalNumber values are less than this parameter are not changed.

TypeDescriptor

Delete all the TypeDescriptors that are child objects of the specified TypeDescriptor, as well as all their child objects, in a recursive manner.