!--a11y-->
Creating a Virtual Interface 
A virtual interface (VI) is the visual representation of a Web service to the outside. Using VIs, it is possible to define several views of a WS endpoint and publish them separately. In a VI you can:
· Hide operations and parameters
· Replace cryptic names for operations and parameters with mnemonic names
· Set standard values for hidden parameters
· Make conversions for parameter data types
· Define parameter representation in the SOAP message
You create a Web service on the basis of an EJB or a Java class.
In the following, how a Web service operates will be described using a program for checking a customer’s credit limit. The program is available as an EJB. It is to be made available as a Web service and incorporated, client-side, in an application program.
To create a VI, proceed as follows:
...
1. Select the name of the EJB, and choose New ® Virtual Interface in the context menu.
2. Enter the name of a package and the name of the VI in the following dialog box.

3. Under the Mapping tab, make the settings for the methods and parameters contained in the EJB.

¡ Remove the checkmark in the checkbox Exposed if the method is not to be offered in the Web service.
¡ If necessary, change the name of the method in the New Name field. The name of the method appears in the WSDL document.
¡ If necessary, change the following parameter options by selecting a parameter.
|
Field: |
Procedure: |
|
New Name
|
Enter a new name for the parameter. |
|
New Type Name |
Choose a new data type. Java-conforming, standard conversions for primitive data types are possible. |
|
Default Value |
Enter a standard value. |
|
Exposed |
Remove the field selection if you wish to hide the parameter. This is only possible if you have entered a standard value and you have a simple data type (int, string, and so on). |
|
Optional |
Select this field if the parameter does not have to be supplied by the caller. This is only possible if you have entered a standard value. |
4. To define the format details for SOAP messages of a Web service, you can maintain SOAP extensions. Choose SOAP extensions under the entries for the methods and parameters. You can define the namespace for the parameter and the representation of the parameter in the SOAP message (as element or attribute). For more information, refer to the section Maintaining SOAP Extensions.
5. Choose the Documentation tab. Create the documentation for the VI.
6. Save you entries through Save Editor Contents.
You have created a VI.
Create a Web Service Definition.
