Top-down development means building the entire interface
yourself, meaning you have no initial interface.
Before you begin
Prerequisite: You must have a module or library.
About this task
In building your interface from the top down, you will learn
how to create operations with inputs, outputs and faults. You will
learn how to use icons and context menus to perform tasks. In the
properties view, you will learn how to modify the interface you create
and display the binding style of an operation.
Procedure
- Right-click your module and from the pop-up menu select New
> Interface. The New Interface Wizard opens. Add a name
to the name field, in our case,
CreditReport, and
click Finish. The empty interface opens in the interface editor.
- Add an operation. Click the Add Request Response Operation icon.
A request-response operation with an input and an output is created.
Rename
operation1 to getBalance.
- By default the binding style selected for your operation
will be document/literal wrapped with is sufficient for most cases.
However, if you will be passing an attachment in your interface, change
the binding style to document/literal non-wrapped, which is selectable
at the top of the editor. See Binding style for information on
the different types of binding styles.
- Change
input1 to balance.
In the Type field, select the default, string.
From the context menu, select double. The type is changed.
- Change
output1 to approval and
the leave the type as string. Add two faults
using the Add Fault icon, a timeout fault
with a string type and systemFailure,
also with a string type. Should you make an
error, use the delete function, available as an icon or from the context
menu if you right-click the item you want deleted. Save your interface.
From the menu bar, select File > Save. These
faults will appear in the properties of bindings which use your interface.
At that time, you can implement the faults with fault selectors.
- Similarly, add another request-response operation called
getHistory with
an input of customerName with a string type
and an output of customerHistory with a string type.
Select the string type of customerHistory and
in the properties view change the Name field to customerPastHistory.
Save your interface. Note that the name is also changed in the table.
You could also click Browse to change the data
type in the Type field.
- Add the same faults in this operation as the previous one.
These faults would return error messages for time out conditions or
a system failure. Add a one-way operation called
updateCreditRating,
either from the icons by selecting Add One Way Operation or
right-clicking the canvas area in the interface editor and selecting
from the context menu. Rename the input currentRating with
a string type. One way operations only send
an input as there is no response required. Save your interface.
- Note that operation types can be changed; that is a Request
Response operation can be changed to a One Way operation or a One
Way operation can be changed to a Request Response operation. Right-click
the operation you want to change and from the context menu select Operation
Type. Choose the type of operation you would prefer.
- To see the properties of the interface, click anywhere
outside the table. The properties of the interface open in the properties
view. The PortType name, namespace, folder, and documentation fields
are shown, and can be modified.
- To see the binding style, select the an operation. In the
properties view, select the Details tab. The operation type
and binding style are shown. In this case, it is a one-way operation
with a Document Literal Wrapped binding style, the default.
What to do next
If you use refactoring to move an operation in your interface,
you can select more than one operation. To do this, select an operation.
Then press and hold Control while selecting
other operations.
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15