Web Service Application
In the Web-based modeler, the web services are invoked using the JAX-WS 2.0 library.
In case you import a model from Eclipse-based modeler which contains the classes generated through
Axis 1.2 in web service application, then the engine won't be able to execute the model.
Viewing and Editing Properties
The following properties can be specified:
Figure: Web Service Application - Configuration
- Application Name - Specify name of the application
- Description - Specify the description
- Public Visibility - By default, this check box is selected. It indicates that
the element is visible and available for reference from any other model.
In case you switch to the Integrator profile,
UUID and ID options are displayed additionally.
- UUID - A unique identifier ID gets generated as an identifier for client server communication
- ID - An ID generated automatically based on the application name.
If element with the same name exists then during ID generation, a numerical suffix gets added to the ID.
If the element is renamed, the ID gets regenerated.
Figure: UUID and UI Properties
Configuration
- WSDL URL - Specify location of the Web Service WSDL and click Load.
The URL must have the following format:
<protocol>:<path>/<document>
You can also specify the path of WSDL URL from local file system.
In case of file, the URL should be, for example,
file:/development/assets/TestService.wsdl.
On Windows, if the document is not on the default device C but on device Y,
you can use the format:
file:/Y/path-on-Y/document.wsdl
When you Load a WSDL, first
Service, Port and Operation are automatically
selected and displayed. As an effect structured data types for the selected operation are created.
- Service - Service to be invoked from the services listed in the previously loaded WSDL specification.
Figure: Web Service Application - Endpoint
- Port - Selects the port to be invoked from the ports provided by the previously selected service.
- Operation - Selects the operation to be invoked from all operations provided by the previously selected port.
Note that Structured Types will be created implicitly with the definition of the Web Service Application Type,
but only SDTs required for the selected Operation will be created.
Creating SDTs via manual import of WSDLs is not supported.
- Style - Displays the encoding style used for the chosen operation.
- Protocol - Displays the protocol used for the chosen operation.
- Use - Displays the message used for the chosen operation.
- Include WS Addressing EPR - Specifies that at runtime a WS-Addressing Endpoint Reference
will be included into the request message.
- Implementation - Specifies the implementation (Generic Resource / Process Manager Specific) of
the above WS-Addressing endpoint.
- Authentication Required - Specifies whether at runtime any standard caller
authentication information is included into the request message.
If this check box is selected, a special access point named Authentication is generated for the activity.
By creating data mappings to this access point you can specify the authentication credentials to be set at runtime.
- Endpoint - If you select the Dynamically Bound Services option from the Service
drop-down list, then the Endpoint option is displayed.
You can specify the endpoint for the web service.
It means that the URL in WSDL file can be different and at the runtime, the user can change the URL.
The dynamically bound service provides an extra access point where you can specify at runtime
the concrete endpoint.
Comments
Click the Comments tab to add comments for the application.
To add the comment, specify the comment in the text box and click Submit.
The newest comment gets displayed at the top of the table.
To delete the comment, select the comment and click the Delete icon.
The user, who has submitted the comment, only that user can delete the comment.
If the other user selects the comment or no comment is selected,
the Delete icon remains in disabled state.
Figure: Comments
Example
In this example, we are loading the http://{hostname}:{port}/{contextName}/services/WeatherForecast?wsdl wsdl
in the web service application. Once the wsdl is loaded, the related service, port, operation etc are populated accordingly.
As an effect, the structured data types GetWeatherByZipCode, WeatherForecasts and GetWeatherByZipCodeResult are created.
Follow the steps
to work with the web service application.
- Create a web service application. Specify following configuration properties:
Figure: Web Service Application
- WSDL URL - Specify http://{hostname}:{port}/{contextName}/services/WeatherForecast?wsdl wsdl
and click Load. Once the wsdl is loaded, the Service, Port,
Operation and all the other fields get populated.
- The structured type named GetWeatherByZipCode gets created. The following screenshot
displays its details.
Figure: Structured Type - GetWeatherByZipCode
- The structured type named WeatherForecasts gets created. The following screenshot
displays its details.
Figure: Structured Type - WeatherForecasts
- The structured type named GetWeatherByZipCodeResult gets created. The following screenshot
displays its details.
Figure: Structured Type - GetWeatherByZipCodeResult
- Create a structured data named GetWeatherByZipCode6 and associate the structured type
GetWeatherByZipCode to it as shown in the following screenshot.
Figure: Structured Data - GetWeatherByZipCode
- Create a structured data named GetWeatherByZipCodeResponse7 and associate the structured type
GetWeatherByZipCodeResponse to it as shown in the following screenshot.
Figure: Structured Data - GetWeatherByZipCodeResult
- Now create a process containing service task and specify the web service application
as the implementation.
The following screenshot displays the properties of the service task.
Figure: Service Task
- Switch to Integrator profile. In the Implementation property of the service task,
select WebServiceAppl application as the Implementation.
Figure: Web Service Task - Implementation
- Create a process and map data with tasks as shown in the following screenshot.
Figure: Process
- Specify in data mapping between the service task and GetWeatherByZipCode6 structured data as shown in the following screenshot.
Figure: Input Data Mapping
- Select parameters_struct(GetWeatherByZipCode) as the input access point. Note that this access point is
created automatically when we load the web service.
- Specify output data mapping between the service task and GetWeatherByZipCodeResponse7 structured data as shown in the following
screenshot.
Figure: Output Data Mapping
- Select parameters_struct(GetWeatherByZipCodeResponse7) as the output access point.
Note that this access point is created automatically when we load the web service.
- Deploy the model. In the Workflow Execution perspective, execute the process Test WS.
Enter the zip code of your city and complete the activity.
Figure: Enter Zip Code
The next activity displays the weather of the city.
Figure: Weather of the City