Saflet101WS

last edited byusericonthelimit on 02-Jan-2010

Contents

Download Sample Saflet

You can download archived sample saflet here.

Create WebService Project

We will create custom initiator saflet for this tutorial.

ws1

Add WebService Actionstep

Select Webservice Action step and add to the saflet.

ws0

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

ws2

It is listing Zipcode as configurable input parameter for GetWeatherByZipCode webservice call. Double click Zipcode in parameters list.

ws3

we specify "97403" as a zipcode parameter value.

ws4

"97403" is configured as input zipcode paramater value for GetWeatherByZipCode webservice call.

ws5

now, select outputs tab, we will configure output value.

ws6

Clicking "+" button will bring up Webservice Output params configuration dialog.

ws7

We select PlaceName for this test as output value.

wsoutput

Now PlaceName is selected for output.

ws8

Time to specify variable for PlaceName output.

ws9

create Local Text Type Variable ResultPlace.

ws10

Ouput Value PlaceName will be written into Local Variable ResultPlace.

ws11

Now Output parameter is configured. PlaceName is written into Local Variable ResultPlace.

ws12

Debugging Webservice Saflet

For debugging purpose, we add two DebugLog actionsteps and configure to display ResultPlace variable.

ws13

After all saflet is wired and configured,click debug button. publish your saflet.

ws14

New debuggin saflet is launched and background is pink because you are debugging.

ws15

Open up custom initiator and select saflet and click send.

ws16

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.

ws17

Webservice call is made and returned result.

ws18

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.

p2

If you access services administrator, it might be configured as below.

p

Change service setting so that service can run under user account. This should solve certain java environment issue.

p3

 
Download in other Formats:
markup Markup | pdf PDF | swf SWF | html HTML | word Word

comments Comments (0)