Previous Topic

Book Contents

Book Index

Next Topic

Create the Workflow

Now it is necessary to create a Valuemation workflow which can be used to call the web service.

The workflow has two 'simple input' nodes:

  • inputCountry
    label: Please enter a country
    default: Germany
  • inputCity
    label: Please enter a city
    default: Stuttgart

Help Image

The script node contains the following script:

from java.net import URL

from javax.xml.namespace import QName

from net.webservicex import GlobalWeather

from net.webservicex import GlobalWeatherSoap

# Webservice initialize

# Creates a URL object from the String representation.

wsdlURL = URL("http://www.webservicex.net/globalweather.asmx?WSDL")

# QName constructor specifying the Namespace URI and local part

qname = QName( "http://www.webserviceX.NET", "GlobalWeather" )

# GlobalWeather constructor

# public GlobalWeather(URL wsdlLocation, QName serviceName)

service = GlobalWeather(wsdlURL, qname)

# public GlobalWeatherSoap getGlobalWeatherSoap()

port = service.getGlobalWeatherSoap()

# Call getWeather(String, String) which returns a String

# public java.lang.String getWeather(

# @WebParam(name = "CityName", targetNamespace = "http://www.webserviceX.NET")

# java.lang.String cityName,

# @WebParam(name = "CountryName", targetNamespace = "http://www.webserviceX.NET")

# java.lang.String countryName

# );

resXML = port.getWeather(city, country)

_output.put("wert", resXML)

Help Image

As a final step, add the workflow to the Valuemation sidebar.

Running the workflow displays an information message displaying the data acquired from the web service.

Help Image

See Also

Calling A WebService Using Workflow

Get the WSDL

Generate The SOAP Client

Integrate the Jar File