Method
Methods are the operations related to an entity that you can perform in the line-of business (LOB) application. Methods represent pointers to business logic in a business application. Examples of methods are "get a list of customers", "get the order with a specified ID", and "update the unit price of a product".
The metadata for a Method essentially describes a method signature; for example, the name of an SQL stored procedure, an SQL query, or a Web services method. The definitions for the method signatures live in the LOB application. The Method metadata object provides the information about that method so the Runtime object model can query the metadata repository for this information when a client wants to execute the method.
Methods contain Parameter, MethodInstance, and FilterDescriptor
You can reuse the same back-end application method for multiple method instances in the Business Data Catalog. For example, the AdventureWorks sample reuses the GetProducts method as both Finder and SpecificFinder. The GetCustomerByID method in the SampleWebService reuses it as a SpecificFinder for customer and as an Association method to get addresses.
Important
Business Data Catalog supports only "first" generation Web services. Therefore, if you are using Windows Communication Foundation Web Services, make sure you are using only WS-I Basic Profile v1.0. Business Data Catalog does not support the eight other binding choices that Windows Communication Foundation offers. For a sample, see the SampleWebService. When you use Web services with overloaded methods, you cannot have multiple methods named identically in the Business Data Catalog metadata. A given entity can use only a single Web proxy method override at a given time. However, you can have multiple methods with the same name in the Web service. The Business Data Catalog will pick the correct method based on the signature in the metadata.
Examples
Database Stored Procedure
<Methods>
<Method Name="CustomerFinder">
<Properties>
<Property Name="RdbCommandText"
Type="System.String">SPFindCustomer</Property>
<Property Name="RdbCommandType"
Type="System.Data.CommandType">StoredProcedure</Property>
</Properties>
….
….
</Method>
</Methods>
Database SQL Query
<Methods>
<Method Name="CustomerFinder">
<Properties>
<Property Name="RdbCommandText"
Type="System.String"> SELECT * FROM Customers </Property>
<Property Name="RdbCommandType"
Type="System.String">Text</Property>
</Properties>
….
….
</Method>
</Methods>
Web Service
<Methods>
<Method Name="Sd_Rfc_Customer_Get1">
….
….
</Method>
</Methods>
Schema
Child | Type | Occurs | Default | Limits / Accepted Values | Description |
---|---|---|---|---|---|
IsStatic |
Attribute (Boolean) |
0..1 |
true |
If true, you can execute this method without an entity instance, by calling the Entity.Execute() object model method. If false, you must execute the method in the context of an entity instance, by calling IEntityInstance.Execute(). Finder methods are static. |
|
FilterDescriptors |
Element |
0..1 |
Max. filter descriptors per method: 200. |
Container element for FilterDescriptor. |
|
Parameters |
Element |
0..1 |
Max. parameters per method: 30. |
Container element for Parameter. |
|
MethodInstances |
Element |
0..1 |
Max. method instances per method: 10. |
Container element for MethodInstance. |
Properties
Following are the properties that the Method object accepts for database systems.
Important
Properties are case-sensitive.
Property | Type | Required | Default Value | Limits/Accepted Values | Comments |
---|---|---|---|---|---|
RdbCommandType |
System.Data.CommandType |
Yes |
None |
Text or StoredProcedure |
You can also use the enums such as System.Data.CommandType.Text. |
RdbCommandText |
System.String |
Yes |
None |
SQL statement to execute or name of the stored procedure. |
Following are the properties that the Method object accepts for Web service systems.
Important
Properties are case-sensitive.
Property | Type | Required | Default Value | Limits/Accepted Values | Comments |
---|---|---|---|---|---|
HttpHeaderUserName |
System.String |
No |
None |
The name of the username header that the Web Service expects. |
For details, see Support for Custom HTTP and SOAP headers in SP1. |
HttpHeaderPassword |
System.String |
No |
None |
The name of the password header that the Web Service expects. |
For details, see Support for Custom HTTP and SOAP headers in SP1. |
SoapHeaderUserNameMemberName |
System.String |
No |
None |
This is the name of the username SOAP header that the Web service understands. |
For details, see Support for Custom HTTP and SOAP headers in SP1 |
SoapHeaderUserNameMemberFieldName |
System.String |
No |
None |
This is the name of the field that contains the username. |
For details, see Support for Custom HTTP and SOAP headers in SP1 |
SoapHeaderPasswordMemberName |
System.String |
No |
None |
This is the name of the password SOAP header that the Web service understands. |
For details, see Support for Custom HTTP and SOAP headers in SP1 |
SoapHeaderPasswordMemberFieldName |
System.String |
No |
None |
This is the name of the field that contains the password. |
For details, see Support for Custom HTTP and SOAP headers in SP1 |
See Also
Tasks
AdventureWorks SQL Server 2000 Sample
How to: Get Started with Using the Runtime Object Model
How to: Get Started with Using the Administration Object Model