Here’s begins a step by step set of “cheat notes” for implementing (ultimately “invoking” or calling) your first Web Service. See prior Web Services Pack entry for some thoughts on getting started in general and finding a sample service.
Assuming you have the WSDL for a nice, basic Service, and have DataStage Designer up and running, and (if on release 7.x) have WSPack successfully installed (it’s already “in” v8), then you are ready to import the WSDL based meta data. From Import…Table Definitions…Web Services Definitions, start the WSDL Meta Data Importer, when it’s up, locate your WSDL. It could be out at a URL somewhere, or use the button to find an already downloaded WSDL. When it’s opened successfully, you’ll its XML on the left, and a tree of its “Operations” on the upper right. For now, think of each “Operation” as like a ‘routine’ or ‘method’ or ‘subroutine.’ You may have one or many listed in this tree if you expand it. Select one of the Operations and then click the “Import” button on the lower right. If all goes well, you’ll see import messages for the input and output of your service.
Now take a moment and review the table definitions that were imported. In your TableDefinitions/WebServices category, find your Operation, and then in there, a set of TableDefs. Open them up. Take a look at their column names and associated meta data. These are the placeholders for the critical meta data of the service you wish to invoke. Some contain SOAP oriented information….but the key ones are named <yourOperation>_IN and <yourOperation>_OUT. They will illustrate the actual input and output arguments of your selected Operation. In most scenarios you wll never need to review these, and it’s just a curiousity for your review. But for some complex services, it will useful to review these Tables and know where they exist.
Now you are ready to build a job. The formal documentation is fairly clear on this point, but as a tip, if you’ve selected a simple service as I’ve advised, be mindful of the following:
- Place a Web Services Transformation Stage on your canvas, and immediately preceed it and follow it by regular Transformer Stages. This is a best practice when startingthat will become clear as you get into advanced techniques.
- When you first open the Stage, the critical button you’ll first see allows you to select your Web Service Operation. This brings up a GUI with some “gear” icons. Select your Web Service, and then click on the “Advanced” button. Note the various Web Service meta data attributes that appear. Port Address is the location of the Service, and is often a good candidate for a DataStage Job Parameter. The others are mostly informational only.
- When “loading” metadata to your import and output links, choose the usual input and output tabs respectively, and then the “message” tab that is visible. When you “load” the message, it knows which Table Definition to bring in, automatically pulls in the namespace details, and will also automatically populate the Columns grid. The most common errors in using WSTransformer for the first time are when users try to load the Column grid first, before loading the message detail and letting the Stage populate the link grid.
If you chose a simple service (some good ones on the link in my first WSPack entry concerning Temperatures), you will be good to go at this point. Supply your input data and send your output to a Peek or Seqeuential file or whatever you like for testing and see if it works!