A service-client binding contains information about how
the EGL runtime code connects to a service that is being invoked by
your EGL code.
Prerequisites
- An EGL project or EGL Web project
- An EGL deployment descriptor
- A Web Services Description Language (WSDL) file that describes
the service to use, which is in your workspace
Adding the service client binding information
- In the deployment descriptor editor, open the EGL deployment descriptor.
- On the Service Client Bindings tab, under
Service Client Bindings, click Add.
- In
the Add a Service Binding window, click Web
Binding and then click Next.
- If
the WSDL file is not in your EGL project but is elsewhere in
your workspace, next to the WSDL File field,
you can select Choose WSDL file from workspace and copy
it to the current project. If that check box is selected,
you can use the Browse mechanism to search
your Workspace. If that check box is clear, you can use the Browse mechanism
to search in the EGL source folders of your project and in the EGL
source folders of any project in the EGL build path of your project.
To access the build-path details, right click your project and click Properties.
In the window that opens, click EGL Build Path.
- Under Interface Options, click Generate
EGL Interface from WSDL file. This choice represents the
preferred method for creating an Interface part to represent the service
at development time.
The process by which the workbench creates
an Interface part is helpful when names that are copied from the WSDL
file are not valid in EGL or when you want to use an EGL package name
that is not derived from the WSDL file. For details, see “@xml.”
If
you select Use existing EGL interface and specify
an existing one, when you work on a specific service-client binding
in the EGL deployment descriptor editor, you can quickly access the
Interface part that you created.
If you specify your own Interface
part, make sure that its function prototypes accurately reflect the
service operations defined in the WSDL file.
- For the Web
Binding Name, either accept
the default value or type in a different name. When you access the
service, the name will be the value of the bindingKey property
field.
- In the WSDL URI field, you can
specify
a string that overrides the URL that is specified in the WSDL file.
If the service is available at a location besides the one that is
specified in the WSDL file, such as a different version of the service
that is used for production or testing, you can enter that location
here and use that version of the service.
- Click Next.
- On the New EGL Interface page, select the Interface parts to create
from the WSDL file.
- Click Next.
- On
the next page, each Interface part has a tab that lists each
function in the selected Interface part. You can select or clear the
check box for any of the functions to choose which functions are represented
in the new Interface part.
- Set the location and name for the
new interface part in the Source
folder, Package, and EGL
source file name fields.
- Click Finish.
Now you can create variables based on the Interface part and
use these variables to access the service. For more information, see
“Declaring an access variable to access a SOAP service.”
Shortcut to add client binding information
You
can add client binding information directly from a WSDL file in your
project by using the following shortcut:
- In the Project
Explorer view, right-click the WSDL file and click Create
EGL Interfaces and Web Client Binding.
- On the
New EGL Interface page, select the interfaces to use from
the WSDL file.
- Click Next.
- On
the next page, each interface has a tab on which each function
in the selected interfaces is listed. You can select or clear the
check box for any of the functions to choose which functions will
be in the new interface part.
- Set the location and name for
the new interface part in the Source
folder, Package, and EGL
source file name fields.
- Click Next.
- In the EGL deployment descriptor file name field,
select the name of the deployment descriptor file to add information
to.
- To update information that is in a deployment descriptor
file,
select Update all existing bindings.
- In
the table of ports, select the ports to generate into interfaces.
You can change the binding name, which is the label for the Web service
deployment listing in the deployment descriptor file.
- Click Finish.