Saflet101WS
Contents |
Download Sample Saflet
You can download archived sample saflet here.
Create WebService Project
We will create custom initiator saflet for this tutorial.
Add WebService Actionstep
Select Webservice Action step and add to the saflet.
Load WSDL and Setup Parameters
Double click Webservice actionstep and it brings up webservice actionstep configureation dialog.
paste http url for wsdl or you can load wsdl from file. then load wsdl file. Once wsdl file is loaded correctly, it should list all the available webservice calls. In here, it is listing GetWeatherByPlaceName and GetWeatherByZipCode as available webservices.
For this example, select GetWeatherByZipCode call:
http://www.webservicex.net/WeatherForecast.asmx?wsdl
More sample web services can be found at: www.webservicex.net
It is listing Zipcode as configurable input parameter for GetWeatherByZipCode webservice call. Double click Zipcode in parameters list.
we specify "97403" as a zipcode parameter value.
"97403" is configured as input zipcode paramater value for GetWeatherByZipCode webservice call.
now, select outputs tab, we will configure output value.
Clicking "+" button will bring up Webservice Output params configuration dialog.
We select PlaceName for this test as output value.
Now PlaceName is selected for output.
Time to specify variable for PlaceName output.
create Local Text Type Variable ResultPlace.
Ouput Value PlaceName will be written into Local Variable ResultPlace.
Now Output parameter is configured. PlaceName is written into Local Variable ResultPlace.
Debugging Webservice Saflet
For debugging purpose, we add two DebugLog actionsteps and configure to display ResultPlace variable.
After all saflet is wired and configured,click debug button. publish your saflet.
New debuggin saflet is launched and background is pink because you are debugging.
Open up custom initiator and select saflet and click send.
Debugging point will be automatically set on Webservice action step. Click next, this step will take a while at the first time since server needs to generate code for webservice dynamically. After first try, delay should be only from actual webservice call. It is totally dependent on webservice availablity and your internet connection.
Webservice call is made and returned result.
Place is Eugene for Zip code "97403". You can play with other output parameters.
Trouble shooting
Vista or windows7 window user could encounter below type of error.
If you access services administrator, it might be configured as below.
Change service setting so that service can run under user account. This should solve certain java environment issue.
SideBar
User Login
Comments (