Select your user interface:
Code Table Example: BizOps (Visual Studio)
The entire code sample can be found here: CodeTableExampleBizOps.zip
Step 1 - Find the feature identifier for the endpoint operation.
Note: For a discussion about feature metadata, see Feature Metadata.
-
Browse to Administration > Application > Features.
-
Click Code table search.
-
Search for the Address Type code table.
-
Select the result. The page that describes the code table appears.
-
Copy the Database table name: ADDRESSTYPECODE.
Step 2 - Create a WinForm project with a Web Service reference to ADDRESSTYPECODE CodeTableService.
-
Use the Endpoint Reference to find the service description for the ADDRESSTYPECODE CodeTableService.
CodeTableService for ADDRESSTYPECODE
For example:
http://localhost/bbAppFx/vpp/bizops/db[BBINFINITY]/codetables/ADDRESSTYPECODE/soap.asmx?WSDL
-
To add the Web Reference in a .NET 4 environment, right-click the project and click Add Service Reference.
Note: In a .NET 2 environment, Web Reference is the standard option.
-
The Add Service Reference screen appears. Click Advanced.
-
The Service Reference Settings screen appears. Click Add Web Reference.
-
The Add Web Reference screen appears. Paste the URL for the BizOps endpoint into the URL field and click the green button. The service information appears.
Also, enter a different name for the Web Reference. For example, enter AddressTypeCodeTableService. Click Add Reference.
Step 3 - Add a Label and ComboBox to the default form.
Rename the Label and ComboBox appropriately.
LabelAddressType
ComboBoxAddressType
Add text to the label. In this case, the combo box will support selecting an Address Type.
Step 4 - Find the endpoint operation to get the list of entries in the Address Type code table.
Use the Endpoint Reference to find the endpoint operation that gets a list of entries for a given code table.
CodeTableService for ADDRESSTYPECODE
GetTableEntryList
Step 5 - Instantiate the client.
Here are the variable declarations and the code to instantiate the client. InitializeCodeTableService is called in the form's load procedure.
Note: For a discussion about Authentication and Authorization, see Authentication and Authorization.
Public Class Form1
Private _codeTableService As AddressTypeCodeTableService.CodeTableService
Private _myCred As System.Net.ICredentials
Private Sub InitializeCodeTableService()
_myCred = GetNetworkCredentials()
_codeTableService = New AddressTypeCodeTableService.CodeTableService
_codeTableService.Credentials = _myCred
End Sub
...
Step 6 - Create the request and reply.
-
In the form's load procedure, add a request and reply to get the list of entries in the code table. The request and reply objects reflect the name of the endpoint operation: GetTableEntryListRequest and GetTableEntryListReply.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load InitializeCodeTableService() Dim req = New AddressTypeCodeTableService.GetTableEntryListRequest() Dim reply = New AddressTypeCodeTableService.GetTableEntryListReply() reply = _codeTableService.GetTableEntryList(req) For Each row In reply.Rows ComboBoxAddressType.Items.Add(row.Description) Next End Sub
You can include additional information in the request. See the following snippet from the Endpoint Reference:
<soap12:Body> <GetTableEntryListRequest xmlns="blackbaud_appfx_server_bizops"> <IncludeInactive>boolean</IncludeInactive> <RefreshCache>boolean</RefreshCache> </GetTableEntryListRequest> </soap12:Body> </soap12:Envelope>
-
Invoke the request.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load InitializeCodeTableService() Dim req = New AddressTypeCodeTableService.GetTableEntryListRequest() Dim reply = New AddressTypeCodeTableService.GetTableEntryListReply() reply = _codeTableService.GetTableEntryList(req) For Each row In reply.Rows ComboBoxAddressType.Items.Add(row.Description) Next End Sub
Step 7 - Populate the combo box with the list from the reply.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeCodeTableService()
Dim req = New AddressTypeCodeTableService.GetTableEntryListRequest()
Dim reply = New AddressTypeCodeTableService.GetTableEntryListReply()
reply = _codeTableService.GetTableEntryList(req)
For Each row In reply.Rows
ComboBoxAddressType.Items.Add(row.Description)
Next
End Sub