Web Service Application

Web Services provide a standardized way to call remote services via HTTP communication. Stardust allows you to use Web Services as an application type for applications invoked by arbitrary activities in a process. Data can be passed to and retrieved from Web Services as parameters via the access point concept.

Note
In the Modeling perspective, Web services are invoked using the JAX-WS 2.0 library. In case you import a model from the Eclipse-based modeler which contains the classes generated through Axis 1.2 in a Web service application, the engine will not be able to execute the model.

Setting Web Service Properties

Apart from the common properties, a Configuration property tab for configuring a Web Service application is provided.


Figure: Web Service Application - Endpoint

Configuring the Web Service Application

The Configuration tab contains the following properties:

Example

In this example, we use the WSDL demo provided by WebserviceX.net offering the current weather and weather conditions for major cities around the world. We load the WSDL URL http://www.webservicex.com/globalweather.asmx?wsdl in an example Web Service application. Once the wsdl is loaded, the related service, port, operation etc are populated accordingly and structured data types are created.

Perform the following steps to work with the Web service application:

  1. Create a Web Service application.
  2. Open the Configuration tab in the application properties page.
  3. Enter http://www.webservicex.com/globalweather.asmx?wsdl in the WSDL URL field and click Load.

    Load WSDL
    Figure: Load WSDL

  4. Once the wsdl is loaded, the Service, Port, Operation and all the other fields get populated.


    Figure: Web Service Application

  5. Two new structured types named GetWeather and GetWeatherResponse get created.


    Figure: Newly created structured types

  6. Structured type GetWeather has only one field:


    Figure: Structured Type - GetWeather

  7. Structured type GetWeatherResponse has the following structure:


    Figure: Structured Type - GetWeatherResponse

  8. Create a structured data named GetWeatherData of the structured type GetWeather as shown in the following screenshot.


    Figure: Structured Data of type GetWeather

  9. Now create a structured data named GetWeatherResponseData of the structured type GetWeatherResponse.


    Figure: Structured Data of type GetWeatherResponse

  10. Create a process and drag the Web Service application to the diagram canvas to create an activity to implement it.
  11. Enter manual activities before and after the Web Service application task and map the structured data we created in the previous steps with these tasks as shown in the following screenshot:


    Figure: Process

  12. Specify an in data mapping between the Web service task and data GetWeatherData as shown in the following screenshot:


    Figure: Input Data Mapping

  13. Select parameters_struct(GetWeather) as the input access point. Note that this access point is created automatically when we load the Web service.
  14. Specify an output data mapping between the Web service task and data GetWeatherResponseData as shown in the following screenshot:


    Figure: Output Data Mapping

  15. Select parameters_struct(GetWeatherResponse) as the output access point. Note that this access point is created automatically when we load the web service.
  16. Deploy the model. In the Workflow Execution perspective, execute the process containing the Web service task. Enter the name of a city and the appropriate country and complete the activity.


    Figure: Enter city and country

The next activity displays all weather details of the entered city (in XML format).


Figure: Weather of the entered city