# SDK User Guide

# Workshop Controls with Oracle Communications Services Gatekeeper

To aid those developers using Workshop for WebLogic Platform™ as their development environment, the Oracle Communications Services Gatekeeper SDK includes a set of custom controls for use in creating clients for Oracle Communications Services Gatekeeper. These controls implement the code needed to access the Web Services interfaces supported by the communication services Oracle Communications Services Gatekeeper provides out-of-the-box and also include support for getting and setting endpoints, getting and using session IDs (for session-based installations), adding attachments, and managing WS-Security Username-Token mechanisms.

Note: | If you are a first time user of Workshop, you may wish to look through the Workshop documentation before reading here to get an idea of how Workshop works. The documents include overview material, tutorials, and other related information. The chapter that covers using controls can be found at http://download.oracle.com/docs/cd/E13224_01/wlw/docs100/guide/controls/navBeehiveControls.html. You can also open up the complete set of documentation by clicking Help ->Help Contents in the Workshop main menu bar. The locally stored help files will open up in your browser. Click on the Workshop for WebLogic Platform User’s Guide in the left navigation bar and select Controls.

## Using the Controls

The Workshop controls for Oracle Communications Services Gatekeeper are packaged as a .jar file (`com.bea.wlcp.wlng.controls.4.1.0.0.jar`) that is located in the `$BEA_HOME/wlserver_10.3/samples/domains/sdk/controls` directory. Complete JavaDoc for the Controls can be found in `$BEA_HOME/wlserver_10.3/samples/domains/sdk/controls.` To use the Controls:

1. Create a Web Services project in Workshop.
2. Drag and drop the .jar file into the `WEB_INF/lib` directory of the project. Workshop will recognize it and register it automatically.
Figure 5-1 Drop the .jar file in WEB_INF/lib

3. Create a New WebLogic Web Service.
4. Right click in the Design view and select New Control Reference.
Figure 5-2 Select New Control Reference

5. From the Select Control dialog box, chose the control you are interested in using.
Figure 5-3 Select Control

6. Once the control has been added, right click on the method you wish to use, and select Generate Delegate Method.
Figure 5-4 Generate Delegate Method

7. The method is inserted in your source code.
Figure 5-5 Method is inserted

## Using the Utility Methods

In addition to the communication service interface methods that are provided by the control, a set of utility methods are also provided. The group includes methods to get and set Web Service endpoints, get and set Session IDs (for session-based installations), get and set WS-Security Username and Password, get and set Attachments for those interfaces that support them. You add these methods to your code in the same way as you add the main interface methods. Mechanisms internal to the controls take care of managing the methods’ use.

Figure 5-6 Utility Methods for Binary SMS(in red)

### Method Signatures for Utility Methods

#### Endpoints

- `public void setEndpoint(String url);`
- `public String getEndpoint();`

#### Session IDs

- `public void setSessionId(String id);`
- `public String getSessionId();`

#### Attachments

- `public void setAttachment(byte[] content, String contentType);`
- `public byte[] getContent();`
- `public String getContentType();`

#### Username Tokens

- `public void setWSSEUsername(String username);`
- `public String getWSSEUsername();`
- `public void setWSSEPassword(String passwd);`
- `public String getWSSEPassword();`

For more information on what these utility methods are managing for you, see the “Interacting with Oracle Communications Services Gatekeeper” chapter in the Application Development Guide, a separate document in this set.