Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

9.10. Import WSDL Into Web Service

9.10.1. Import WSDL Into Web Service

You can create a Web Service model by selecting a WSDL file in your workspace, importing WSDL files from the file system or by defining a URL. The Teiid Designer will interpret the WSDL, locate any associated or dependent XML Schema files, generate an XML View of the schema components and create a Web Service model representing the interfaces and operations defined in the WSDL.
There are three options for selecting the WSDL for your Web Service generation:
  • Workspace Location
  • File System Location
  • URL
Detailed steps for each of these options is described below, as well as a description of how the wizard handles WSDL errors.

9.10.2. Import WSDL from Workspace Location

You can create a Web Service model by selecting a WSDL file from your workspace.
  1. Click the File > Import action in the toolbar or select a project, folder or model in the tree and click Import...
  2. Select the import option Teiid Designer > WSDL File or URL >> Web Service Model option shown below and click Next>.
  3. Enter a valid name for your Web Service model and click the Workspace... button. Locate your workspace WSDL file in the selection dialog and click OK>. Click Next> to continue.
    WSDL File Selection Dialog

    Figure 9.43. WSDL File Selection Dialog

    WSDL File Workspace Selection Dialog

    Figure 9.44. WSDL File Workspace Selection Dialog

    Note

    • If no WSDL is selected or specified then the importer will only create an empty Web Service model. No XML Schema or XML View models will be generated.
    • Any referenced files (WSDLs or schemas) must either be embedded in the WSDL file or exist on your file system.
  4. The next page is titled Namespace Resolution. This page identifies successful and errant WSDL namespace resolution. The main WSDL document will essentially always be resolved, since the workspace file chooser is used to obtain the path. Problems will occur when the main WSDL file imports other WSDL files that cannot be resolved. If no errors, click Next to proceed, or Finish (if enabled) to complete with default options.
    Namespace Resolution Dialog

    Figure 9.45. Namespace Resolution Dialog

  5. The next page WSDL Operations Selection allows customizing the resulting content of your Web Service model by selecting/deselecting various operations and interfaces in the following dialog.
    Namespace Resolution Dialog

    Figure 9.46. Namespace Resolution Dialog

  6. The next page is titled Schema Workspace Location Selection. This page lists all schemas imported by the WSDL (along with any dependent schemas referenced within schemas) as well as schemas embedded in the WSDL and indicates whether or not they are resolvable. All resolved schemas will be created in a separate file and added to the workspace. The editor panel allows you to change the default file name of the new schema file(s).
    If no errors, click Next to proceed, or Finish to complete with default option.
    Namespace Resolution Dialog

    Figure 9.47. Namespace Resolution Dialog

  7. The last page titled XML Model Generation allows you to change the name of the XML View model if the Generate virtual XML document model is checked. Enter desired name or use the default name provide. Click Finish to complete.
    Namespace Resolution Dialog

    Figure 9.48. Namespace Resolution Dialog

In order to successfully generate Web Services from WSDL, the WSDL must be error free. WSDL validation is performed during Step 3 above. If errors do exist, a error summary dialog will be displayed (shown below) and you will not be able to finish the wizard until the WSDL problems are fixed or you re-import and select a valid WSDL file.
WSDL Validation Problems Dialog

Figure 9.49. WSDL Validation Problems Dialog

9.10.3. Import WSDL from File System Location

You can create a Web Service model by selecting a WSDL file from your local file system.
  1. Click the File > Import action in the toolbar or select a project, folder or model in the tree and click Import...
  2. Select the import option Teiid Designer > WSDL File or URL >> Web Service Model and click Next>.
  3. Input a valid name for your Web Service model and click the File System... button. Locate your file system WSDL file in the selection dialog and click OK>.
    WSDL File Selection Dialog

    Figure 9.50. WSDL File Selection Dialog

    Note

    • If no WSDL is selected or specified then the importer will only create an empty Web Service model. No XML Schema or XML View models will be generated.
    • Any referenced files (WSDLs or schemas) must either be embedded in the WSDL file or exist on your file system.
  4. The next page is titled Namespace Resolution. This page identifies successful and errant WSDL namespace resolution. The main WSDL document will essentially always be resolved, since the workspace file chooser is used to obtain the path. Problems will occur when the main WSDL file imports other WSDL files that cannot be resolved. If no errors, click Next to proceed, or Finish (if enabled) to complete with default options.
    Namespace Resolution Dialog

    Figure 9.51. Namespace Resolution Dialog

  5. The next page WSDL Operations Selection allows customizing the resulting content of your Web Service model by selecting/deselecting various operations and interfaces in the following dialog.
    Namespace Resolution Dialog

    Figure 9.52. Namespace Resolution Dialog

  6. The next page is titled Schema Workspace Location Selection. This page lists all schemas imported by the WSDL (along with any dependent schemas referenced within schemas) as well as schemas embedded in the WSDL and indicates whether or not they are resolvable. All resolved schemas will be created in a separate file and added to the workspace. The editor panel allows you to change the default file name of the new schema file(s).
    If no errors, click Next to proceed, or Finish to complete with default option.
    Namespace Resolution Dialog

    Figure 9.53. Namespace Resolution Dialog

  7. The last page titled XML Model Generation allows you to change the name of the XML View model if the Generate virtual XML document model is selected. Enter the desired name or use the default name provided. Click Finish to complete.
    Namespace Resolution Dialog

    Figure 9.54. Namespace Resolution Dialog

In order to successfully generate Web Services from WSDL, the WSDL must be error free. WSDL validation is performed during Step 3 above. If errors do exist, a error summary dialog will be displayed (shown below) and you will not be able to finish the wizard until the WSDL problems are fixed or you re-import and select a valid WSDL file.
WSDL Validation Problems Dialog

Figure 9.55. WSDL Validation Problems Dialog

9.10.4. Import WSDL from URL

You can create a Web Service model by selecting a WSDL file based on a URL.
  1. Click the File > Import action in the toolbar or select a project, folder or model in the tree and click Import...
  2. Click the import option Teiid Designer > WSDL File or URL >> Web Service Model and click Next>.
  3. Input a valid name for your Web Service model and click the URL... button.
    1. Enter a valid WSDL URL. If the URL cannot be validated then an error will be displayed and the OK> button will be disabled.
    2. If the WSDL is protected by basic HTTP authentication then this option should be selected and the appropriate username and password entered.
    3. Click OK> to continue.
    Click Next> to continue.
    WSDL URL Dialog

    Figure 9.56. WSDL URL Dialog

    Note

    • If no WSDL is selected or specified then the importer will only create an empty Web Service model. No XML Schema or XML View models will be generated.
    • Any referenced files (WSDLs or schemas) must either be embedded in the WSDL file or exist on your file system.
  4. The next page is titled Namespace Resolution. This page identifies successful and errant WSDL namespace resolution. The main WSDL document will essentially always be resolved, since the workspace file chooser is used to obtain the path. Problems will occur when the main WSDL file imports other WSDL files that cannot be resolved. If no errors, click Next to proceed, or Finish (if enabled) to complete with default options.
    Namespace Resolution Dialog

    Figure 9.57. Namespace Resolution Dialog

  5. The next page WSDL Operations Selection allows customizing the resulting content of your Web Service model by selecting/deselecting various operations and interfaces in the following dialog.
    Namespace Resolution Dialog

    Figure 9.58. Namespace Resolution Dialog

  6. The next page is titled Schema Workspace Location Selection. This page lists all schemas imported by the WSDL (along with any dependent schemas referenced within schemas) as well as schemas embedded in the WSDL and indicates whether or not they are resolvable. All resolved schemas will be created in a separate file and added to the workspace. The editor panel allows you to change the default file name of the new schema file(s).
    If no errors, click Next to proceed, or Finish to complete with default option.
    Namespace Resolution Dialog

    Figure 9.59. Namespace Resolution Dialog

  7. The last page titled XML Model Generation allows you to change the name of the XML View model if the Generate virtual XML document model is checked. Enter desired name or use the default name provide. Click Finish to complete.
    Namespace Resolution Dialog

    Figure 9.60. Namespace Resolution Dialog

In order to successfully generate Web Services from WSDL, the WSDL must be error free. WSDL validation is performed during Step 3 above. If errors do exist, a error summary dialog will be displayed (shown below) and you will not be able to finish the wizard until the WSDL problems are fixed or you re-import and select a valid WSDL file.
WSDL Validation Problems Dialog

Figure 9.61. WSDL Validation Problems Dialog